[clutter/clutter-1.22] evdev: Lookup config to report touchpads as such



commit 1cabee8d24ad57208de7d4c4b8a34cdd93cd1d43
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Nov 11 10:59:26 2014 +0100

    evdev: Lookup config to report touchpads as such
    
    Check a touchpad-only setting, and if it returns an expected value there,
    the device must be a CLUTTER_DEVICE_TOUCHPAD.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=741350

 clutter/evdev/clutter-input-device-evdev.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/clutter/evdev/clutter-input-device-evdev.c b/clutter/evdev/clutter-input-device-evdev.c
index 812f144..cdd38a7 100644
--- a/clutter/evdev/clutter-input-device-evdev.c
+++ b/clutter/evdev/clutter-input-device-evdev.c
@@ -189,8 +189,12 @@ _clutter_input_device_evdev_update_leds (ClutterInputDeviceEvdev *device,
 ClutterInputDeviceType
 _clutter_input_device_evdev_determine_type (struct libinput_device *ldev)
 {
-
-  if (libinput_device_has_capability (ldev, LIBINPUT_DEVICE_CAP_POINTER))
+  /* This setting is specific to touchpads and alike, only in these
+   * devices there is this additional layer of touch event interpretation.
+   */
+  if (libinput_device_config_tap_get_finger_count (ldev) > 0)
+    return CLUTTER_TOUCHPAD_DEVICE;
+  else if (libinput_device_has_capability (ldev, LIBINPUT_DEVICE_CAP_POINTER))
     return CLUTTER_POINTER_DEVICE;
   else if (libinput_device_has_capability (ldev, LIBINPUT_DEVICE_CAP_TOUCH))
     return CLUTTER_TOUCHSCREEN_DEVICE;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]