From edbf8bf2ce3cf4b98c5251cad7ea300bc984e333 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 29 Feb 2024 12:20:55 +0100 Subject: [PATCH] input-device: drop wlr_input_device.{vendor,product} These aren't super useful without the bus type. Compositors can fish back this information from the libinput device if they want to. Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3818 --- backend/libinput/keyboard.c | 2 -- backend/libinput/pointer.c | 2 -- backend/libinput/switch.c | 2 -- backend/libinput/tablet_pad.c | 2 -- backend/libinput/tablet_tool.c | 2 -- backend/libinput/touch.c | 2 -- backend/wayland/tablet_v2.c | 2 -- include/wlr/types/wlr_input_device.h | 3 --- 8 files changed, 17 deletions(-) diff --git a/backend/libinput/keyboard.c b/backend/libinput/keyboard.c index 9cdc72af..7518453e 100644 --- a/backend/libinput/keyboard.c +++ b/backend/libinput/keyboard.c @@ -26,8 +26,6 @@ void init_device_keyboard(struct wlr_libinput_input_device *dev) { const char *name = get_libinput_device_name(dev->handle); struct wlr_keyboard *wlr_kb = &dev->keyboard; wlr_keyboard_init(wlr_kb, &libinput_keyboard_impl, name); - wlr_kb->base.vendor = libinput_device_get_id_vendor(dev->handle); - wlr_kb->base.product = libinput_device_get_id_product(dev->handle); libinput_device_led_update(dev->handle, 0); } diff --git a/backend/libinput/pointer.c b/backend/libinput/pointer.c index 0c55695f..034b178a 100644 --- a/backend/libinput/pointer.c +++ b/backend/libinput/pointer.c @@ -11,8 +11,6 @@ void init_device_pointer(struct wlr_libinput_input_device *dev) { const char *name = get_libinput_device_name(dev->handle); struct wlr_pointer *wlr_pointer = &dev->pointer; wlr_pointer_init(wlr_pointer, &libinput_pointer_impl, name); - wlr_pointer->base.vendor = libinput_device_get_id_vendor(dev->handle); - wlr_pointer->base.product = libinput_device_get_id_product(dev->handle); } struct wlr_libinput_input_device *device_from_pointer( diff --git a/backend/libinput/switch.c b/backend/libinput/switch.c index 56ad77de..abeec86d 100644 --- a/backend/libinput/switch.c +++ b/backend/libinput/switch.c @@ -11,8 +11,6 @@ void init_device_switch(struct wlr_libinput_input_device *dev) { const char *name = get_libinput_device_name(dev->handle); struct wlr_switch *wlr_switch = &dev->switch_device; wlr_switch_init(wlr_switch, &libinput_switch_impl, name); - wlr_switch->base.vendor = libinput_device_get_id_vendor(dev->handle); - wlr_switch->base.product = libinput_device_get_id_product(dev->handle); } struct wlr_libinput_input_device *device_from_switch( diff --git a/backend/libinput/tablet_pad.c b/backend/libinput/tablet_pad.c index 864fcf88..98b3e4f4 100644 --- a/backend/libinput/tablet_pad.c +++ b/backend/libinput/tablet_pad.c @@ -93,8 +93,6 @@ void init_device_tablet_pad(struct wlr_libinput_input_device *dev) { const char *name = get_libinput_device_name(handle); struct wlr_tablet_pad *wlr_tablet_pad = &dev->tablet_pad; wlr_tablet_pad_init(wlr_tablet_pad, &libinput_tablet_pad_impl, name); - wlr_tablet_pad->base.vendor = libinput_device_get_id_vendor(handle); - wlr_tablet_pad->base.product = libinput_device_get_id_product(handle); wlr_tablet_pad->button_count = libinput_device_tablet_pad_get_num_buttons(handle); diff --git a/backend/libinput/tablet_tool.c b/backend/libinput/tablet_tool.c index 4b1c484a..af50ba9f 100644 --- a/backend/libinput/tablet_tool.c +++ b/backend/libinput/tablet_tool.c @@ -20,8 +20,6 @@ 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->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); diff --git a/backend/libinput/touch.c b/backend/libinput/touch.c index ceb21679..077cdf2d 100644 --- a/backend/libinput/touch.c +++ b/backend/libinput/touch.c @@ -11,8 +11,6 @@ void init_device_touch(struct wlr_libinput_input_device *dev) { const char *name = get_libinput_device_name(dev->handle); struct wlr_touch *wlr_touch = &dev->touch; wlr_touch_init(wlr_touch, &libinput_touch_impl, name); - wlr_touch->base.vendor = libinput_device_get_id_vendor(dev->handle); - wlr_touch->base.product = libinput_device_get_id_product(dev->handle); libinput_device_get_size(dev->handle, &wlr_touch->width_mm, &wlr_touch->height_mm); diff --git a/backend/wayland/tablet_v2.c b/backend/wayland/tablet_v2.c index 11254bcb..53e7c914 100644 --- a/backend/wayland/tablet_v2.c +++ b/backend/wayland/tablet_v2.c @@ -813,8 +813,6 @@ static void handle_tablet_id(void *data, struct zwp_tablet_v2 *zwp_tablet_v2, struct wlr_wl_seat *seat = data; struct wlr_tablet *tablet = &seat->wlr_tablet; - tablet->base.vendor = vid; - tablet->base.product = pid; tablet->usb_vendor_id = vid; tablet->usb_product_id = pid; } diff --git a/include/wlr/types/wlr_input_device.h b/include/wlr/types/wlr_input_device.h index 24a02483..7f78cf2b 100644 --- a/include/wlr/types/wlr_input_device.h +++ b/include/wlr/types/wlr_input_device.h @@ -36,12 +36,9 @@ enum wlr_input_device_type { * * Input devices are typically advertised by the new_input event in * struct wlr_backend. - * - * The vendor/product are bus-specific identifiers. */ struct wlr_input_device { enum wlr_input_device_type type; - unsigned int vendor, product; char *name; // may be NULL struct {