fix: slider drag not working — motion events missing WINGs view target on Wayland

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.
This commit is contained in:
Ollie 2026-05-30 12:49:59 +02:00
parent d615077df8
commit 0342794845
1 changed files with 12 additions and 1 deletions

View File

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