From ab933c656552bc131ecc8b0aecfee6cea950196d Mon Sep 17 00:00:00 2001 From: lkn Date: Wed, 24 Jun 2026 22:25:11 +0200 Subject: [PATCH] wayland: fix close button for internal window panels The close button on internal windows (dock app settings, etc.) did nothing because: 1. wwin->protocols.DELETE_WINDOW was never set for internal windows, so windowCloseClick skipped the wClientSendProtocol call. 2. Even if it were called, wl_client_send_protocol just called client_close which looks for an XDG/XWayland surface. Internal windows have synthetic WINGs view IDs, not real surfaces. Fix: set DELETE_WINDOW protocol flag in wManageInternalWindow, and handle internal windows in wl_client_send_protocol by calling wUnmanageWindow directly. --- src/backend/wayland/wl_client.c | 4 ++++ src/window.c | 1 + 2 files changed, 5 insertions(+) diff --git a/src/backend/wayland/wl_client.c b/src/backend/wayland/wl_client.c index a216c26..e0e4638 100644 --- a/src/backend/wayland/wl_client.c +++ b/src/backend/wayland/wl_client.c @@ -585,6 +585,10 @@ void wl_client_send_protocol(WWindow *wwin, unsigned long protocol, unsigned long timestamp) { (void)protocol; (void)timestamp; + if (wwin->flags.internal_window) { + wUnmanageWindow(wwin, False, False); + return; + } wm_backend->client_close(wwin->client_win); } diff --git a/src/window.c b/src/window.c index 2204422..cd10c18 100644 --- a/src/window.c +++ b/src/window.c @@ -1425,6 +1425,7 @@ WWindow *wManageInternalWindow(WScreen *scr, WNativeWindow window, WNativeWindow wwin->frame->on_mousedown_titlebar = titlebarMouseDown; wwin->frame->on_dblclick_titlebar = titlebarDblClick; wwin->frame->on_mousedown_resizebar = resizebarMouseDown; + wwin->protocols.DELETE_WINDOW = 1; wwin->client.y += wwin->frame->top_width; wm_backend->client_reparent(wwin->client_win, wwin->frame->core->window,