From 949fc9f94a1858300de2fdbba14ca5de324569c4 Mon Sep 17 00:00:00 2001 From: lkn Date: Sun, 21 Jun 2026 16:57:16 +0200 Subject: [PATCH] wayland: destroy XWayland appicons on surface unmap Call wApplicationDestroy after wUnmanageWindow in the XWayland unmap handler, matching the XDG and X11 handleDestroyNotify paths. Fixes XWayland appicons persisting after the application closes. --- src/backend/wayland/wl_xwayland.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/backend/wayland/wl_xwayland.c b/src/backend/wayland/wl_xwayland.c index 1655721..9a7a204 100644 --- a/src/backend/wayland/wl_xwayland.c +++ b/src/backend/wayland/wl_xwayland.c @@ -14,6 +14,7 @@ #include #include #include "../../screen.h" +#include "../../application.h" #include "window.h" #include "wl_types.h" #include @@ -196,7 +197,14 @@ handle_xwayland_unmap(struct wl_listener *listener, void *data) WObjDescriptor *desc = wm_backend->context_find(view->id, WM_CTX_CLIENT_WIN); if (desc && desc->parent_type == WCLASS_WINDOW) { WWindow *wwin = (WWindow *)desc->parent; + WNativeWindow main_win = wwin->main_window; wUnmanageWindow(wwin, False, True); + WApplication *app = wApplicationOf(main_win); + if (app) { + if (main_win == app->main_window) + app->refcount = 0; + wApplicationDestroy(app); + } } } }