From 403ee93ec42a426bfce8f2759976f033824e9f8f Mon Sep 17 00:00:00 2001 From: lkn Date: Sat, 23 May 2026 13:53:39 +0200 Subject: [PATCH] fix: WINGs dialog click-to-focus lookup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The WINGs view ID is not in the context table — only the fake leader (parent frame_buf) is registered. Walk up to parent_id for the context_find lookup so the WWindow is found correctly. Also removed the ID >= 0x20000000 guard so any frame_buf click (including WM frames without a toplevel surface) triggers focus. --- src/backend/wayland/wl_backend.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/backend/wayland/wl_backend.c b/src/backend/wayland/wl_backend.c index 78b9591..0e97e46 100644 --- a/src/backend/wayland/wl_backend.c +++ b/src/backend/wayland/wl_backend.c @@ -5210,9 +5210,11 @@ handle_pointer_button(struct wl_listener *listener, void *data) /* No toplevel surface — check if a WINGs dialog frame_buf was clicked */ struct wl_frame_buf *hit = frame_buf_hit(wl_state.pointer_x, wl_state.pointer_y); - if (hit && hit->id >= 0x20000000) { + if (hit) { + /* Walk up to the parent frame to find the WWindow */ + WNativeWindow lookup = hit->parent_id ? hit->parent_id : hit->id; WObjDescriptor *desc = - wm_backend->context_find(hit->id, WM_CTX_CLIENT_WIN); + wm_backend->context_find(lookup, WM_CTX_CLIENT_WIN); if (desc && desc->parent_type == WCLASS_WINDOW) { WWindow *wwin = (WWindow *)desc->parent; WScreen *scr = wScreenWithNumber(0);