fix appicon state: destroy WApplication before wUnmanageWindow

wApplicationDestroy needs main_window_desc (the wwin) to clean up
the appicon and remove the app from the screen list. Call it before
wUnmanageWindow which frees wwin. This restores the appicon to
"not running" state when a Wayland client closes.
This commit is contained in:
lkn 2026-06-23 23:01:24 +02:00
parent 0fcbe20cad
commit 2581233351
1 changed files with 8 additions and 0 deletions

View File

@ -402,7 +402,15 @@ handle_toplevel_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;
wwin->flags.destroyed = 1;
/* Destroy app BEFORE unmanage so wApplicationDestroy can
* still access main_window_desc (which unmanage frees). */
WApplication *app = wApplicationOf(main_win);
if (app) {
app->refcount = 0;
wApplicationDestroy(app);
}
wUnmanageWindow(wwin, False, True);
}
}