fix: clicking WINGs dialog surface now focuses the window

The click-to-focus code only checked wl_toplevel_view surfaces
(real Wayland/XWayland clients). WINGs dialogs are frame_bufs,
not toplevel views, so view_surface_at returned NULL and focus
was never set.

Add fallback: when no toplevel surface is under the pointer,
check if a WINGs dialog frame_buf (ID >= 0x20000000) was hit
and focus its associated WWindow.
This commit is contained in:
lkn 2026-05-23 13:51:45 +02:00
parent ee8489e3a1
commit 7fe8121913
1 changed files with 13 additions and 0 deletions

View File

@ -5206,6 +5206,19 @@ handle_pointer_button(struct wl_listener *listener, void *data)
wl_list_remove(&view->link); wl_list_remove(&view->link);
wl_list_insert(&wl_state.toplevel_list, &view->link); wl_list_insert(&wl_state.toplevel_list, &view->link);
} }
} else {
/* 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) {
WObjDescriptor *desc =
wm_backend->context_find(hit->id, WM_CTX_CLIENT_WIN);
if (desc && desc->parent_type == WCLASS_WINDOW) {
WWindow *wwin = (WWindow *)desc->parent;
WScreen *scr = wScreenWithNumber(0);
wSetFocusTo(scr, wwin);
}
}
} }
} }