tablet-tool: add usb_vendor_id and usb_product_id to wlr_tablet

This commit is contained in:
Simon Ser 2024-02-29 12:20:02 +01:00 committed by Isaac Freund
parent 22178451f7
commit e21b975f5d
3 changed files with 5 additions and 0 deletions

View File

@ -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);

View File

@ -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,

View File

@ -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 {