summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2020-07-14 12:22:48 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2020-07-15 03:24:44 +0000
commiteededbeb7faa2b6182c02a84884f54c1cb1d8a2a (patch)
tree0f336680ec9a424eae1d5c1709affe22e1e44f4a
parentc9ff7e78d9b1249f70438fb77b91b32f87d67d21 (diff)
downloadlibinput-eededbeb7faa2b6182c02a84884f54c1cb1d8a2a.tar.gz
evdev: fix the check for tablet vs joystick
A device may have ID_INPUT_JOYSTICK and ID_INPUT_KEY in which case it would still get added, despite being a joystick device. Make sure we check only the tablet and joystick bits - where a device has the joystick bit set but not the tablet one we ignore it. Note that this check will get removed in the next commit anyway, it's just here to make tracking the change easier in the history (and figuring out where potential regressions come from). Fixes #415 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/evdev.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/evdev.c b/src/evdev.c
index 124b07a0..560412aa 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -1812,9 +1812,10 @@ evdev_configure_device(struct evdev_device *device)
/* libwacom *adds* TABLET, TOUCHPAD but leaves JOYSTICK in place, so
make sure we only ignore real joystick devices */
- if (udev_tags == (EVDEV_UDEV_TAG_INPUT|EVDEV_UDEV_TAG_JOYSTICK)) {
- evdev_log_info(device,
- "device is a joystick, ignoring\n");
+ const unsigned int joystick_tag = EVDEV_UDEV_TAG_JOYSTICK;
+ const unsigned int joystick_or_tablet_tag = EVDEV_UDEV_TAG_JOYSTICK|EVDEV_UDEV_TAG_TABLET;
+ if ((udev_tags & joystick_or_tablet_tag) == joystick_tag) {
+ evdev_log_info(device, "device is a joystick, ignoring\n");
return NULL;
}