From e01dedb833d53df07fcf0c5031e2a474b69317eb Mon Sep 17 00:00:00 2001 From: Window Maker Date: Sun, 24 May 2026 17:37:24 +0200 Subject: [PATCH] WINGs/wclient_wl: set button.x/y in motion events for widget compat WMEButton.x is at offset 40, WMEMotion.x is at offset 48. The scroller widget reads event->u.button.x for motion events (legacy X11 code where XButtonEvent and XMotionEvent have x at the same offset). Set both union members so widgets reading either get correct coordinates. --- WINGs/wclient_wl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/WINGs/wclient_wl.c b/WINGs/wclient_wl.c index 6cc5c1d..1ad9718 100644 --- a/WINGs/wclient_wl.c +++ b/WINGs/wclient_wl.c @@ -695,6 +695,10 @@ pointer_handle_motion(void *data, struct wl_pointer *p, uint32_t time, ev.u.motion.x_root = (int)wlc_ptr_x; ev.u.motion.y_root = (int)wlc_ptr_y; ev.u.motion.state = wlc_ptr_button_state | wlc_ptr_mods; + /* Also set button.x/y — some widgets (wscroller) read motion coords + * via event->u.button.x which is at a different union offset. */ + ev.u.button.x = lx; + ev.u.button.y = ly; W_WL_EnqueueEvent(ctx->scr, &ev, target); }