From 71577e351e7954467e2376ac7bb92edc4ce53159 Mon Sep 17 00:00:00 2001 From: Simon Zeni Date: Fri, 4 Feb 2022 09:26:57 -0500 Subject: types/wlr_input_device: default vendor and product id to 0 vendor and product id are set when needed by the libinput backend --- backend/libinput/events.c | 7 +++---- backend/wayland/seat.c | 5 +---- backend/x11/backend.c | 2 +- backend/x11/output.c | 4 ++-- 4 files changed, 7 insertions(+), 11 deletions(-) (limited to 'backend') diff --git a/backend/libinput/events.c b/backend/libinput/events.c index 67598998..1f28b94a 100644 --- a/backend/libinput/events.c +++ b/backend/libinput/events.c @@ -48,8 +48,6 @@ static struct wlr_input_device *allocate_device( struct wlr_libinput_backend *backend, struct libinput_device *libinput_dev, struct wl_list *wlr_devices, enum wlr_input_device_type type) { - int vendor = libinput_device_get_id_vendor(libinput_dev); - int product = libinput_device_get_id_product(libinput_dev); const char *name = libinput_device_get_name(libinput_dev); struct wlr_libinput_input_device *dev = calloc(1, sizeof(struct wlr_libinput_input_device)); @@ -66,8 +64,9 @@ static struct wlr_input_device *allocate_device( wl_list_insert(wlr_devices, &dev->link); dev->handle = libinput_dev; libinput_device_ref(libinput_dev); - wlr_input_device_init(wlr_dev, type, &input_device_impl, - name, vendor, product); + wlr_input_device_init(wlr_dev, type, &input_device_impl, name); + wlr_dev->vendor = libinput_device_get_id_vendor(libinput_dev); + wlr_dev->product = libinput_device_get_id_product(libinput_dev); return wlr_dev; } diff --git a/backend/wayland/seat.c b/backend/wayland/seat.c index 76c25fe5..d22d5e63 100644 --- a/backend/wayland/seat.c +++ b/backend/wayland/seat.c @@ -466,8 +466,6 @@ struct wlr_wl_input_device *create_wl_input_device( struct wlr_input_device *wlr_dev = &dev->wlr_input_device; - unsigned int vendor = 0, product = 0; - const char *type_name = "unknown"; switch (type) { @@ -495,8 +493,7 @@ struct wlr_wl_input_device *create_wl_input_device( char name[name_size]; (void) snprintf(name, name_size, "wayland-%s-%s", type_name, seat->name); - wlr_input_device_init(wlr_dev, type, &input_device_impl, name, vendor, - product); + wlr_input_device_init(wlr_dev, type, &input_device_impl, name); wl_list_insert(&seat->backend->devices, &dev->link); return dev; } diff --git a/backend/x11/backend.c b/backend/x11/backend.c index ae20559c..70fc0478 100644 --- a/backend/x11/backend.c +++ b/backend/x11/backend.c @@ -639,7 +639,7 @@ struct wlr_backend *wlr_x11_backend_create(struct wl_display *display, #endif wlr_input_device_init(&x11->keyboard_dev, WLR_INPUT_DEVICE_KEYBOARD, - &input_device_impl, "X11 keyboard", 0, 0); + &input_device_impl, "X11 keyboard"); wlr_keyboard_init(&x11->keyboard, &keyboard_impl); x11->keyboard_dev.keyboard = &x11->keyboard; diff --git a/backend/x11/output.c b/backend/x11/output.c index b87b08dc..d500795f 100644 --- a/backend/x11/output.c +++ b/backend/x11/output.c @@ -574,13 +574,13 @@ struct wlr_output *wlr_x11_output_create(struct wlr_backend *backend) { wlr_output_update_enabled(wlr_output, true); wlr_input_device_init(&output->pointer_dev, WLR_INPUT_DEVICE_POINTER, - &input_device_impl, "X11 pointer", 0, 0); + &input_device_impl, "X11 pointer"); wlr_pointer_init(&output->pointer, &pointer_impl); output->pointer_dev.pointer = &output->pointer; output->pointer_dev.output_name = strdup(wlr_output->name); wlr_input_device_init(&output->touch_dev, WLR_INPUT_DEVICE_TOUCH, - &input_device_impl, "X11 touch", 0, 0); + &input_device_impl, "X11 touch"); wlr_touch_init(&output->touch, &touch_impl); output->touch_dev.touch = &output->touch; output->touch_dev.output_name = strdup(wlr_output->name); -- cgit v1.2.3