From 21522a1bf83c60f9c9a4e23d874fadf0fe0b5366 Mon Sep 17 00:00:00 2001 From: Andrew Hamilton Date: Tue, 25 Aug 2026 22:30:34 +1000 Subject: [PATCH] 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. --- kick.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/kick.c b/kick.c index 073a34a..5742ad2 100644 --- a/kick.c +++ b/kick.c @@ -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); }