From 748280f9de602ac340f4bc64599d356407bd76ee Mon Sep 17 00:00:00 2001 From: Alberto Fanjul Date: Sat, 5 Feb 2022 09:08:35 +0100 Subject: 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 --- src/evdev-tablet-pad.c | 20 ++++++++++++++++---- 1 file 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; -- cgit v1.2.1