diff --git a/backend/libinput/meson.build b/backend/libinput/meson.build index f4592891e..0dfac5dd6 100644 --- a/backend/libinput/meson.build +++ b/backend/libinput/meson.build @@ -31,3 +31,4 @@ wlr_deps += libinput # libinput hold gestures and high resolution scroll are available since 1.19.0 internal_config.set10('HAVE_LIBINPUT_HOLD_GESTURES', libinput.version().version_compare('>=1.19.0')) internal_config.set10('HAVE_LIBINPUT_SCROLL_VALUE120', libinput.version().version_compare('>=1.19.0')) +internal_config.set10('HAVE_LIBINPUT_BUSTYPE', libinput.version().version_compare('>=1.26.0')) diff --git a/backend/libinput/tablet_tool.c b/backend/libinput/tablet_tool.c index af50ba9fa..cc9e60968 100644 --- a/backend/libinput/tablet_tool.c +++ b/backend/libinput/tablet_tool.c @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -20,8 +21,14 @@ void init_device_tablet(struct wlr_libinput_input_device *dev) { const char *name = get_libinput_device_name(dev->handle); struct wlr_tablet *wlr_tablet = &dev->tablet; wlr_tablet_init(wlr_tablet, &libinput_tablet_impl, name); - wlr_tablet->usb_vendor_id = libinput_device_get_id_vendor(dev->handle); - wlr_tablet->usb_product_id = libinput_device_get_id_product(dev->handle); + +#if HAVE_LIBINPUT_BUSTYPE + if (libinput_device_get_id_bustype(dev->handle) == BUS_USB) +#endif + { + wlr_tablet->usb_vendor_id = libinput_device_get_id_vendor(dev->handle); + wlr_tablet->usb_product_id = libinput_device_get_id_product(dev->handle); + } libinput_device_get_size(dev->handle, &wlr_tablet->width_mm, &wlr_tablet->height_mm);