From bdd1b8dc60ced4f2a36154c2dd993eab28817927 Mon Sep 17 00:00:00 2001 From: Jens Peters Date: Tue, 10 Jun 2025 19:40:48 +0200 Subject: [PATCH] input: handle tablet tool creation internally No need anymore to expose this function. --- include/input/tablet.h | 1 - src/input/tablet.c | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/include/input/tablet.h b/include/input/tablet.h index 55bdd0c9..29aeb72b 100644 --- a/include/input/tablet.h +++ b/include/input/tablet.h @@ -49,7 +49,6 @@ struct drawing_tablet { void tablet_init(struct seat *seat); void tablet_finish(struct seat *seat); void tablet_create(struct seat *seat, struct wlr_input_device *wlr_input_device); -void tablet_tool_create(struct seat *seat, struct wlr_tablet_tool *wlr_tablet_tool); bool tablet_tool_has_focused_surface(struct seat *seat); #endif /* LABWC_TABLET_H */ diff --git a/src/input/tablet.c b/src/input/tablet.c index 49d2aaeb..a4ec328a 100644 --- a/src/input/tablet.c +++ b/src/input/tablet.c @@ -66,7 +66,7 @@ handle_tablet_tool_destroy(struct wl_listener *listener, void *data) free(tool); } -void +static struct drawing_tablet_tool * tablet_tool_create(struct seat *seat, struct wlr_tablet_tool *wlr_tablet_tool) { @@ -89,6 +89,7 @@ tablet_tool_create(struct seat *seat, tool->handlers.destroy.notify = handle_tablet_tool_destroy; wl_list_insert(&seat->tablet_tools, &tool->link); + return tool; } static enum motion @@ -330,8 +331,7 @@ handle_tablet_tool_proximity(struct wl_listener *listener, void *data) * Unfortunately `wlr_tool` is only present in the events, so * use proximity for creating a `wlr_tablet_v2_tablet_tool`. */ - tablet_tool_create(tablet->seat, ev->tool); - return; + tool = tablet_tool_create(tablet->seat, ev->tool); } /* -- 2.52.0