From 34be4b128705fbb93ddf7d614293421b4072d6b1 Mon Sep 17 00:00:00 2001 From: lkn Date: Sat, 6 Jun 2026 21:17:30 +0200 Subject: [PATCH] Alt+drag: validate WINGs fb hit via context_find When handle_pointer_button finds a client surface at the pointer (_surf && _tv), it searches frame_list for overlapping WINGs frame_bufs. Previously it used any WINGs fb found, including stale entries with bogus IDs (e.g. 0x1). Now it validates the WINGs fb via context_find() before using it as the event window. If validation fails, the event routes to _tv->id. --- src/backend/wayland/wl_handlers.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/backend/wayland/wl_handlers.c b/src/backend/wayland/wl_handlers.c index d69d210..86a5fe4 100644 --- a/src/backend/wayland/wl_handlers.c +++ b/src/backend/wayland/wl_handlers.c @@ -229,15 +229,11 @@ handle_pointer_button(struct wl_listener *listener, void *data) break; } } - wev.window = _wtb ? _wtb->id : _tv->id; + WObjDescriptor *_wd = wm_backend->context_find(_wtb->id, WM_CTX_CLIENT_WIN); + wev.window = _wd ? _wtb->id : _tv->id; wev.u.button.window = wev.window; wev.u.button.x = (int)_sx; wev.u.button.y = (int)_sy; - wwarning("btn-route: ptr=(%d,%d) tv=0x%lx surf=%p sxsy=(%.1f,%.1f) wings_fb=%s final=0x%lx local=(%d,%d)", - wl_state.pointer_x, wl_state.pointer_y, - (unsigned long)_tv->id, (void*)_surf, _sx, _sy, - _wtb ? "yes" : "no", (unsigned long)wev.window, - wev.u.button.x, wev.u.button.y); } else { struct wl_frame_buf *fb = frame_buf_hit(wl_state.pointer_x, wl_state.pointer_y);