Skip to content
This repository was archived by the owner on Aug 6, 2020. It is now read-only.

Commit 774ff9b

Browse files
whotkeszybz
authored andcommitted
udev: don't assign INPUT_ID_MOUSE to a touchpad/joystick/touchscreen (systemd#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
1 parent 6719ca7 commit 774ff9b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/udev/udev-builtin-input_id.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,8 @@ static bool test_pointers(struct udev_device *dev,
233233
is_touchscreen = true;
234234
}
235235

236-
if (has_mouse_button &&
236+
if (!is_tablet && !is_touchpad && !is_joystick &&
237+
has_mouse_button &&
237238
(has_rel_coordinates ||
238239
!has_abs_coordinates)) /* mouse buttons and no axis */
239240
is_mouse = true;

0 commit comments

Comments
 (0)