From f08d8b3913cf316bb54ddaa7bc5bf664e99513fe Mon Sep 17 00:00:00 2001 From: Guido Cella Date: Mon, 19 Oct 2026 22:57:02 +0200 Subject: [PATCH] fix segfault when XWayland fails to initialize Fixes https://codeberg.org/dwl/dwl/issues/1202 --- dwl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dwl.c b/dwl.c index 216deb5..738639b 100644 --- a/dwl.c +++ b/dwl.c @@ -876,8 +876,10 @@ cleanuplisteners(void) wl_list_remove(&new_session_lock.link); wl_list_remove(&new_foreign_toplevel_capture_request.link); #ifdef XWAYLAND - wl_list_remove(&new_xwayland_surface.link); - wl_list_remove(&xwayland_ready.link); + if (xwayland) { + wl_list_remove(&new_xwayland_surface.link); + wl_list_remove(&xwayland_ready.link); + } #endif }