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:
parent
0fcbe20cad
commit
2581233351
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue