summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlberto Fanjul <albertofanjul@gmail.com>2022-02-05 09:08:35 +0100
committerAlberto Fanjul <albertofanjul@gmail.com>2022-02-07 21:26:47 +0100
commit748280f9de602ac340f4bc64599d356407bd76ee (patch)
tree33b44d6416016ad82f286b60e91f06f6125cabf0
parent8e41089584f81da40d25249fe2c95bb277ac17d6 (diff)
downloadlibinput-748280f9de602ac340f4bc64599d356407bd76ee.tar.gz
pad: load libwacom device by path, not by usbid
to avoid conflicts with vendors reusing vid:pid try to find first by path Signed-off-by: Alberto Fanjul <albertofanjul@gmail.com>
-rw-r--r--src/evdev-tablet-pad.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/evdev-tablet-pad.c b/src/evdev-tablet-pad.c
index 4f4f7b57..fdce7322 100644
--- a/src/evdev-tablet-pad.c
+++ b/src/evdev-tablet-pad.c
@@ -556,15 +556,27 @@ pad_init_buttons_from_libwacom(struct pad_dispatch *pad,
WacomDevice *tablet = NULL;
int num_buttons;
int map = 0;
+ char event_path[64];
db = libinput_libwacom_ref(li);
if (!db)
goto out;
- tablet = libwacom_new_from_usbid(db,
- evdev_device_get_id_vendor(device),
- evdev_device_get_id_product(device),
- NULL);
+ snprintf(event_path,
+ sizeof(event_path),
+ "/dev/input/%s",
+ evdev_device_get_sysname(device));
+ tablet = libwacom_new_from_path(db,
+ event_path,
+ WFALLBACK_NONE,
+ NULL);
+ if (!tablet) {
+ tablet = libwacom_new_from_usbid(db,
+ evdev_device_get_id_vendor(device),
+ evdev_device_get_id_product(device),
+ NULL);
+ }
+
if (!tablet)
goto out;