From e21b975f5d01aeff3c7dbd59e9ab8d88756cd65d Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 29 Feb 2024 12:20:02 +0100 Subject: [PATCH] tablet-tool: add usb_vendor_id and usb_product_id to wlr_tablet --- backend/libinput/tablet_tool.c | 2 ++ backend/wayland/tablet_v2.c | 2 ++ include/wlr/types/wlr_tablet_tool.h | 1 + 3 files changed, 5 insertions(+) diff --git a/backend/libinput/tablet_tool.c b/backend/libinput/tablet_tool.c index 9747c758e..4b1c484ad 100644 --- a/backend/libinput/tablet_tool.c +++ b/backend/libinput/tablet_tool.c @@ -22,6 +22,8 @@ void init_device_tablet(struct wlr_libinput_input_device *dev) { wlr_tablet_init(wlr_tablet, &libinput_tablet_impl, name); wlr_tablet->base.vendor = libinput_device_get_id_vendor(dev->handle); wlr_tablet->base.product = libinput_device_get_id_product(dev->handle); + 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); diff --git a/backend/wayland/tablet_v2.c b/backend/wayland/tablet_v2.c index 6d793881f..11254bcbf 100644 --- a/backend/wayland/tablet_v2.c +++ b/backend/wayland/tablet_v2.c @@ -815,6 +815,8 @@ static void handle_tablet_id(void *data, struct zwp_tablet_v2 *zwp_tablet_v2, tablet->base.vendor = vid; tablet->base.product = pid; + tablet->usb_vendor_id = vid; + tablet->usb_product_id = pid; } static void handle_tablet_path(void *data, struct zwp_tablet_v2 *zwp_tablet_v2, diff --git a/include/wlr/types/wlr_tablet_tool.h b/include/wlr/types/wlr_tablet_tool.h index 41d637f07..e71c92344 100644 --- a/include/wlr/types/wlr_tablet_tool.h +++ b/include/wlr/types/wlr_tablet_tool.h @@ -64,6 +64,7 @@ struct wlr_tablet { const struct wlr_tablet_impl *impl; + uint16_t usb_vendor_id, usb_product_id; // zero if unset double width_mm, height_mm; struct {