fix: WINGs dialog click-to-focus lookup

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.
This commit is contained in:
lkn 2026-05-23 13:53:39 +02:00
parent 7fe8121913
commit 403ee93ec4
1 changed files with 4 additions and 2 deletions

View File

@ -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);