mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-25 22:10:05 +01:00
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>
This commit is contained in:
parent
c9ff7e78d9
commit
eededbeb7f
1 changed files with 4 additions and 3 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue