summaryrefslogtreecommitdiff
path: root/src/udev/udev-builtin-input_id.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2022-02-23 09:12:43 +1000
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-02-23 09:03:21 +0100
commit8ac9ec4d5c210825759d515422d3e66c20615fc1 (patch)
tree13aad6c4a883448b14e86900022ef927b2e3f145 /src/udev/udev-builtin-input_id.c
parentf2acaf39c1f680d526df6cda8052cbf2f7f75ba0 (diff)
downloadsystemd-8ac9ec4d5c210825759d515422d3e66c20615fc1.tar.gz
udev-builtin-input_id: don't label absolute mice as pointing sticks
The Getac UX10 tablet exposes a "CUST0000:00 0EEF:C002 Mouse" device with BTN_LEFT/RIGHT and ABS_X/Y on the i2c bus. This causes the builtin to incorrectly label it as pointing stick (all i2c mice are tagged as ID_INPUT_POINTING_STICK, see 3d7ac1c655ec4). Fix this by adding a separate variable for absolute pointing devices like the VMmouse USB mouse or this Getac tablet - this way we skip the pointing stick check. See https://gitlab.freedesktop.org/libinput/libinput/-/issues/743 for recordings.
Diffstat (limited to 'src/udev/udev-builtin-input_id.c')
-rw-r--r--src/udev/udev-builtin-input_id.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/udev/udev-builtin-input_id.c b/src/udev/udev-builtin-input_id.c
index 4c43080e8d..a34f6de617 100644
--- a/src/udev/udev-builtin-input_id.c
+++ b/src/udev/udev-builtin-input_id.c
@@ -167,6 +167,7 @@ static bool test_pointers(sd_device *dev,
bool finger_but_no_pen = false;
bool has_mouse_button = false;
bool is_mouse = false;
+ bool is_abs_mouse = false;
bool is_touchpad = false;
bool is_touchscreen = false;
bool is_tablet = false;
@@ -231,7 +232,7 @@ static bool test_pointers(sd_device *dev,
else if (has_mouse_button)
/* This path is taken by VMware's USB mouse, which has
* absolute axes, but no touch/pressure button. */
- is_mouse = true;
+ is_abs_mouse = true;
else if (has_touch || is_direct)
is_touchscreen = true;
else if (has_joystick_axes_or_buttons)
@@ -263,7 +264,7 @@ static bool test_pointers(sd_device *dev,
if (is_pointing_stick)
udev_builtin_add_property(dev, test, "ID_INPUT_POINTINGSTICK", "1");
- if (is_mouse)
+ if (is_mouse || is_abs_mouse)
udev_builtin_add_property(dev, test, "ID_INPUT_MOUSE", "1");
if (is_touchpad)
udev_builtin_add_property(dev, test, "ID_INPUT_TOUCHPAD", "1");
@@ -276,7 +277,7 @@ static bool test_pointers(sd_device *dev,
if (is_tablet_pad)
udev_builtin_add_property(dev, test, "ID_INPUT_TABLET_PAD", "1");
- return is_tablet || is_mouse || is_touchpad || is_touchscreen || is_joystick || is_pointing_stick;
+ return is_tablet || is_mouse || is_abs_mouse || is_touchpad || is_touchscreen || is_joystick || is_pointing_stick;
}
/* key like devices */