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.
This commit is contained in:
lkn 2026-06-21 16:57:16 +02:00
parent 3d953339f8
commit 949fc9f94a
1 changed files with 8 additions and 0 deletions

View File

@ -14,6 +14,7 @@
#include <X11/cursorfont.h>
#include <wlr/types/wlr_output.h>
#include "../../screen.h"
#include "../../application.h"
#include "window.h"
#include "wl_types.h"
#include <WINGs/WINGsP.h>
@ -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);
}
}
}
}