Skip to content

xwayland: Aggregate scroll axis events to fix kinetic scrolling

David Jacewicz requested to merge djacewicz/xserver:fix-kinetic-scrolling into master

Fixes: #926 (closed)

Pointer scroll events are collected in xwl_seat->pending_pointer_event as they are received in the pointer_handle_axis and pointer_handle_axis_discrete callbacks. They are dispatched together as a single event when pointer_handle_frame is called which "Indicates the end of a set of events that logically belong together". This patch also sends an event with dx=0, dy=0 when pointer_handle_axis_stop is called, which is what allows XWayland clients to recognise the end of a touchpad scroll.

Before this patch, testing xinput --test-xi2 directly on X and scrolling with a touchpad shows that the horizontal and vertical scroll events may be combined into a single event, and this always happens at the end of a touchpad scroll to indicate the end of the scroll gesture (dx=0, dy=0 is sent). This behaviour is not seen on Xwayland, and this patch fixes that.

For example, running GDK_BACKEND=x11 evince on XWayland, kinetic scrolling does not work before this patch because the (0,0) event is never sent. With this patch, it looks like kinetic scrolling works as it should.

Signed-off-by: David Jacewicz david.jacewicz27@protonmail.com

Edited by David Jacewicz

Merge request reports