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.
This commit is contained in:
parent
7efede0274
commit
e01dedb833
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue