From: Peter Hutterer Date: Fri, 23 Feb 2018 08:36:45 +0000 (+1000) Subject: udev: don't assign INPUT_ID_MOUSE to a touchpad/joystick/touchscreen (#8259) X-Git-Tag: v238~62 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=774ff9ba69c08d8331c4268059637f289ce059bb;p=thirdparty%2Fsystemd.git udev: don't assign INPUT_ID_MOUSE to a touchpad/joystick/touchscreen (#8259) If a touchpad has MT axes only but not ABS_X/ABS_Y (DualShock 4 controller), then we hit both the conditions is_touchpad and the later check for !has_abs_axes here, assigning is_mouse and ID_INPUT_MOUSE later. This is a bug, we historically only assigned either of of the pointing device tags ID_INPUT_MOUSE/TOUCHPAD/JOYSTICK/TOUCHSCREEN, never multiple of them. Note that we cannot just check for has_abs_axes and has_mt_coordinates because the apple touch mouse has both. We really need to check if the device has already been assigned something else. https://bugs.freedesktop.org/show_bug.cgi?id=105050 --- diff --git a/src/udev/udev-builtin-input_id.c b/src/udev/udev-builtin-input_id.c index fa830213ffe..02b86cce239 100644 --- a/src/udev/udev-builtin-input_id.c +++ b/src/udev/udev-builtin-input_id.c @@ -233,7 +233,8 @@ static bool test_pointers(struct udev_device *dev, is_touchscreen = true; } - if (has_mouse_button && + if (!is_tablet && !is_touchpad && !is_joystick && + has_mouse_button && (has_rel_coordinates || !has_abs_coordinates)) /* mouse buttons and no axis */ is_mouse = true;