fix xwayland assert crash: drop pending associate listener unconditionally

x11_pending_teardown only removed the pending's associate listener when
the surface had been hooked (associated).  the listener is attached
unconditionally at new_surface, so an X11 window destroyed before ever
associating -- VLC's short-lived probe windows do exactly that -- left
it linked on events.associate, and wlroots' xwayland_surface_destroy
asserted on the non-empty list, killing kick.
This commit is contained in:
Andrew Hamilton 2026-08-25 22:30:34 +10:00
parent fd4099076c
commit 21522a1bf8

10
kick.c
View file

@ -3872,10 +3872,14 @@ struct kick_x11_pending {
static void x11_pending_teardown(struct kick_x11_pending *p) {
wl_list_remove(&p->link);
wl_list_remove(&p->destroy.link);
if (p->surface_hooked) {
wl_list_remove(&p->associate.link);
/* The associate listener is attached unconditionally at new_surface, so
it must be removed unconditionally here too: a window destroyed
before ever associating a Wayland surface (VLC's short-lived
probe windows) leaves it linked otherwise, and wlroots asserts on
the non-empty associate list at destroy. */
wl_list_remove(&p->associate.link);
if (p->surface_hooked)
wl_list_remove(&p->map.link);
}
free(p);
}