From d7ae9a866bf2372e0e86a9cf51a963b4fbc30c08 Mon Sep 17 00:00:00 2001 From: JiDe Zhang Date: Mon, 15 Sep 2025 15:58:51 +0800 Subject: [PATCH] xwayland: fix assertion failure in wlr_xwayland_shell_v1 The issue occurred when `wlr_xwayland_shell_v1` was destroyed before `wlr_xwayland`. This happened because `wlr_xwayland` didn't remove the listener for the shell's destroy event in `handle_shell_destroy`. --- xwayland/xwayland.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xwayland/xwayland.c b/xwayland/xwayland.c index d25a132b5..5d51df074 100644 --- a/xwayland/xwayland.c +++ b/xwayland/xwayland.c @@ -69,6 +69,11 @@ static void handle_shell_destroy(struct wl_listener *listener, void *data) { struct wlr_xwayland *xwayland = wl_container_of(listener, xwayland, shell_destroy); xwayland->shell_v1 = NULL; + wl_list_remove(&xwayland->shell_destroy.link); + // Will remove this list in handle_shell_destroy(). + // This ensures the link is always initialized and + // avoids the need to keep check conditions in sync. + wl_list_init(&xwayland->shell_destroy.link); } void wlr_xwayland_destroy(struct wlr_xwayland *xwayland) {