From 7dd8fdf76c4e58e99c768a1f025777ddc8585a1a Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Sun, 27 Apr 2025 11:25:23 +0200 Subject: [PATCH] tablet-v2: cleanup focused surface on tool destroy Currently the surface_destroy listener may not get removed if destroy_tablet_tool_v2() is called while the tool is in proximity to a surface. Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3969 Reported-by: Hooman Ise --- types/tablet_v2/wlr_tablet_v2_tool.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/types/tablet_v2/wlr_tablet_v2_tool.c b/types/tablet_v2/wlr_tablet_v2_tool.c index 8574a9a2f..e73aa767b 100644 --- a/types/tablet_v2/wlr_tablet_v2_tool.c +++ b/types/tablet_v2/wlr_tablet_v2_tool.c @@ -103,7 +103,10 @@ void destroy_tablet_tool_v2(struct wl_resource *resource) { } if (client->tool && client->tool->current_client == client) { + wl_list_remove(&client->tool->surface_destroy.link); + wl_list_init(&client->tool->surface_destroy.link); client->tool->current_client = NULL; + client->tool->focused_surface = NULL; } wl_list_remove(&client->seat_link);