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
This commit is contained in:
Isaac Freund 2025-04-27 11:25:23 +02:00 committed by Simon Ser
parent 648aee65ad
commit 7dd8fdf76c

View file

@ -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);