udev: Fix touch screen detection
authorAndreas Pokorny <andreas.pokorny@canonical.com>
Fri, 1 Jan 2016 12:35:36 +0000 (13:35 +0100)
committerAndreas Pokorny <andreas.pokorny@canonical.com>
Fri, 1 Jan 2016 12:35:36 +0000 (13:35 +0100)
Use BTN_TOUCH or INPUT_PROP_DIRECT to detect touch screens.

Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
src/udev/udev-builtin-input_id.c

index 1d31829..a7aac78 100644 (file)
@@ -205,12 +205,12 @@ static bool test_pointers(struct udev_device *dev,
                         /* This path is taken by VMware's USB mouse, which has
                          * absolute axes, but no touch/pressure button. */
                         is_mouse = true;
-                else if (has_touch)
+                else if (has_touch || is_direct)
                         is_touchscreen = true;
                 else if (has_joystick_axes_or_buttons)
                         is_joystick = true;
         }
-        if (has_mt_coordinates && is_direct)
+        if (has_mt_coordinates && (is_direct || has_touch))
                 is_touchscreen = true;
 
         if (has_rel_coordinates && has_mouse_button)