]> git.mdlowis.com Git - proto/labwc.git/commitdiff
input: handle tablet tool creation internally
authorJens Peters <jp7677@gmail.com>
Tue, 10 Jun 2025 17:40:48 +0000 (19:40 +0200)
committerJohan Malm <johanmalm@users.noreply.github.com>
Sat, 14 Jun 2025 12:45:51 +0000 (13:45 +0100)
No need anymore to expose this function.

include/input/tablet.h
src/input/tablet.c

index 55bdd0c906baccef4b13a171b9b7cc762a8735d6..29aeb72b30851469bf015cc364a1d2071e1b8724 100644 (file)
@@ -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 */
index 49d2aaebb4e64010d9e4bed1630b189c93f92888..a4ec328ab64b4892e935bf232af4c92e2aa03463 100644 (file)
@@ -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);
        }
 
        /*