diff options
| -rw-r--r-- | backend/libinput/tablet_tool.c | 6 | ||||
| -rw-r--r-- | backend/wayland/tablet_v2.c | 2 | ||||
| -rw-r--r-- | include/wlr/interfaces/wlr_tablet_tool.h | 2 | ||||
| -rw-r--r-- | include/wlr/types/wlr_tablet_tool.h | 2 | ||||
| -rw-r--r-- | types/wlr_tablet_tool.c | 8 | 
5 files changed, 16 insertions, 4 deletions
| diff --git a/backend/libinput/tablet_tool.c b/backend/libinput/tablet_tool.c index 60208a87..31803e81 100644 --- a/backend/libinput/tablet_tool.c +++ b/backend/libinput/tablet_tool.c @@ -75,7 +75,11 @@ struct wlr_tablet *create_libinput_tablet(  	}  	struct wlr_tablet *wlr_tablet = &libinput_tablet->wlr_tablet; -	wlr_tablet_init(wlr_tablet, &tablet_impl); +	const char *name = libinput_device_get_name(libinput_dev); + +	wlr_tablet_init(wlr_tablet, &tablet_impl, name); +	wlr_tablet->base.vendor = libinput_device_get_id_vendor(libinput_dev); +	wlr_tablet->base.product = libinput_device_get_id_product(libinput_dev);  	struct udev_device *udev = libinput_device_get_udev_device(libinput_dev);  	char **dst = wl_array_add(&wlr_tablet->paths, sizeof(char *)); diff --git a/backend/wayland/tablet_v2.c b/backend/wayland/tablet_v2.c index 34056314..4ddcce07 100644 --- a/backend/wayland/tablet_v2.c +++ b/backend/wayland/tablet_v2.c @@ -909,7 +909,7 @@ static void handle_tab_added(void *data,  		return;  	}  	zwp_tablet_v2_set_user_data(id, wlr_dev->tablet); -	wlr_tablet_init(wlr_dev->tablet, NULL); +	wlr_tablet_init(wlr_dev->tablet, NULL, wlr_dev->name);  	zwp_tablet_v2_add_listener(id, &tablet_listener, dev);  } diff --git a/include/wlr/interfaces/wlr_tablet_tool.h b/include/wlr/interfaces/wlr_tablet_tool.h index 81e72d75..de7430a2 100644 --- a/include/wlr/interfaces/wlr_tablet_tool.h +++ b/include/wlr/interfaces/wlr_tablet_tool.h @@ -16,7 +16,7 @@ struct wlr_tablet_impl {  };  void wlr_tablet_init(struct wlr_tablet *tablet, -		const struct wlr_tablet_impl *impl); +	const struct wlr_tablet_impl *impl, const char *name);  void wlr_tablet_destroy(struct wlr_tablet *tablet);  #endif diff --git a/include/wlr/types/wlr_tablet_tool.h b/include/wlr/types/wlr_tablet_tool.h index 75fc1ee8..b8b4000f 100644 --- a/include/wlr/types/wlr_tablet_tool.h +++ b/include/wlr/types/wlr_tablet_tool.h @@ -60,6 +60,8 @@ struct wlr_tablet_tool {  struct wlr_tablet_impl;  struct wlr_tablet { +	struct wlr_input_device base; +  	const struct wlr_tablet_impl *impl;  	struct { diff --git a/types/wlr_tablet_tool.c b/types/wlr_tablet_tool.c index 5c0037bd..12278e93 100644 --- a/types/wlr_tablet_tool.c +++ b/types/wlr_tablet_tool.c @@ -1,11 +1,16 @@  #include <stdlib.h>  #include <string.h>  #include <wayland-server-core.h> +#include <wlr/interfaces/wlr_input_device.h>  #include <wlr/interfaces/wlr_tablet_tool.h>  #include <wlr/types/wlr_tablet_tool.h>  void wlr_tablet_init(struct wlr_tablet *tablet, -		const struct wlr_tablet_impl *impl) { +		const struct wlr_tablet_impl *impl, const char *name) { +	wlr_input_device_init(&tablet->base, WLR_INPUT_DEVICE_TABLET_TOOL, NULL, +		name); +	tablet->base.tablet = tablet; +  	tablet->impl = impl;  	wl_signal_init(&tablet->events.axis);  	wl_signal_init(&tablet->events.proximity); @@ -25,6 +30,7 @@ void wlr_tablet_destroy(struct wlr_tablet *tablet) {  	}  	wl_array_release(&tablet->paths); +	wlr_input_device_finish(&tablet->base);  	if (tablet->impl && tablet->impl->destroy) {  		tablet->impl->destroy(tablet);  	} else { | 
