mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-05-09 04:48:02 +02:00
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>
This commit is contained in:
parent
8e41089584
commit
748280f9de
1 changed files with 16 additions and 4 deletions
|
|
@ -556,15 +556,27 @@ pad_init_buttons_from_libwacom(struct pad_dispatch *pad,
|
||||||
WacomDevice *tablet = NULL;
|
WacomDevice *tablet = NULL;
|
||||||
int num_buttons;
|
int num_buttons;
|
||||||
int map = 0;
|
int map = 0;
|
||||||
|
char event_path[64];
|
||||||
|
|
||||||
db = libinput_libwacom_ref(li);
|
db = libinput_libwacom_ref(li);
|
||||||
if (!db)
|
if (!db)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
tablet = libwacom_new_from_usbid(db,
|
snprintf(event_path,
|
||||||
evdev_device_get_id_vendor(device),
|
sizeof(event_path),
|
||||||
evdev_device_get_id_product(device),
|
"/dev/input/%s",
|
||||||
NULL);
|
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)
|
if (!tablet)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue