summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2014-11-26 17:15:48 +0100
committerCarlos Garnacho <carlosg@gnome.org>2014-12-11 11:35:56 +0100
commita18b2f067bca19f364e2abc3105282c6a7f47fe4 (patch)
treeff9990c56825c10f47e82487bb7295e6471a1859
parent8afb499ce506b68716b4262bc16eb3d2a031bce1 (diff)
downloadclutter-a18b2f067bca19f364e2abc3105282c6a7f47fe4.tar.gz
evdev: Prefer pointer/touch devices over keyboard devices
In keyboard/mouse wireless combos, it is rather common for the mouse to claim it contains the multimedia keys, this makes libinput enable both the pointer and keyboard capabilities on this device, and Clutter thus to create a keyboard ClutterInputDevice for it. Ideally clutter devices should be able to reflect their full capabilities, or maybe account for the fact that certain events can be sent from seemingly unexpected device types. But this will bring a somewhat better behavior on such devices. https://bugzilla.gnome.org/show_bug.cgi?id=740518
-rw-r--r--clutter/evdev/clutter-input-device-evdev.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/clutter/evdev/clutter-input-device-evdev.c b/clutter/evdev/clutter-input-device-evdev.c
index 4b94ae9a1..812f1440f 100644
--- a/clutter/evdev/clutter-input-device-evdev.c
+++ b/clutter/evdev/clutter-input-device-evdev.c
@@ -190,12 +190,12 @@ ClutterInputDeviceType
_clutter_input_device_evdev_determine_type (struct libinput_device *ldev)
{
- if (libinput_device_has_capability (ldev, LIBINPUT_DEVICE_CAP_KEYBOARD))
- return CLUTTER_KEYBOARD_DEVICE;
- else if (libinput_device_has_capability (ldev, LIBINPUT_DEVICE_CAP_POINTER))
+ 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;
+ else if (libinput_device_has_capability (ldev, LIBINPUT_DEVICE_CAP_KEYBOARD))
+ return CLUTTER_KEYBOARD_DEVICE;
else
return CLUTTER_EXTENSION_DEVICE;
}