wayland: fix close button for WINGs clients by flushing after send_close

This commit is contained in:
Window Maker 2026-05-25 13:31:38 +02:00
parent 36c2396130
commit 94157394d7
1 changed files with 3 additions and 15 deletions

View File

@ -7562,21 +7562,9 @@ wl_client_close(WNativeWindow win)
wlr_xwayland_surface_close(v->xw_surface);
} else if (v->xdg_surface && v->xdg_surface->toplevel) {
wlr_xdg_toplevel_send_close(v->xdg_surface->toplevel);
/* For in-process WINGs clients, also directly synthesize the
* close event since the client may not dispatch immediately. */
WMScreen *wmscr = wl_get_wmscreen();
if (wmscr) {
WMEvent ev;
memset(&ev, 0, sizeof(ev));
ev.type = WME_CLIENT_MESSAGE;
ev.window = win;
ev.u.clientMessage.message_type = wmscr->protocolsAtom;
ev.u.clientMessage.format = 32;
ev.u.clientMessage.data.l[0] = wmscr->deleteWindowAtom;
extern W_View *W_GetViewForWindow(unsigned long id);
W_View *view = W_GetViewForWindow((unsigned long)win);
W_WL_EnqueueEvent(wmscr, &ev, view);
}
/* Flush so the in-process client receives the close event,
* then dispatch so it processes it on this iteration. */
wl_display_flush_clients(wl_state.display);
}
}