From 034279484502a483ad14c295dfd9dfd0fbb6a3f4 Mon Sep 17 00:00:00 2001 From: Ollie Date: Sat, 30 May 2026 12:49:59 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20slider=20drag=20not=20working=20?= =?UTF-8?q?=E2=80=94=20motion=20events=20missing=20WINGs=20view=20target?= =?UTF-8?q?=20on=20Wayland?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit handle_pointer_motion enqueued WME_MOTION events with target=NULL. On button press, handle_pointer_button correctly resolves the WINGs child view (slider) via W_FindViewAtPoint and sets _view_target, so the slider receives the press and sets dragging=1. But subsequent motion events had NULL target, so WMHandleEvent routed them to the top-level view instead of the slider view — the slider never received WME_MOTION during drag. Fix: add W_FindViewAtPoint resolution in handle_pointer_motion, matching the button press logic. --- src/backend/wayland/wl_backend.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/backend/wayland/wl_backend.c b/src/backend/wayland/wl_backend.c index 4a4a160..00d9307 100644 --- a/src/backend/wayland/wl_backend.c +++ b/src/backend/wayland/wl_backend.c @@ -5226,7 +5226,18 @@ handle_pointer_motion(struct wl_listener *listener, void *data) wev.u.motion.time = ev->time_msec; wev.u.motion.x_root = wl_state.pointer_x; wev.u.motion.y_root = wl_state.pointer_y; - W_WL_EnqueueEvent(wmscr, &wev, NULL); + /* Resolve WINGs child view (slider, etc.) at pointer for + * motion routing during drag operations. */ + struct W_View *mtarget = NULL; + if (fb && fb->id >= 0x20000000) { + extern W_View *W_GetViewForWindow(unsigned long id); + extern struct W_View *W_FindViewAtPoint(struct W_View *parent, int x, int y); + W_View *toplevel = W_GetViewForWindow((unsigned long)fb->id); + if (toplevel) + mtarget = W_FindViewAtPoint(toplevel, + wev.u.motion.x, wev.u.motion.y); + } + W_WL_EnqueueEvent(wmscr, &wev, mtarget); /* Emit synthetic LEAVE/ENTER when pointer crosses WM sub-window * boundaries (titlebar ↔ button, etc.). These feed the inner * press-track loop in framewin.c:buttonMouseDown so the cancel-