forge
Explore
Log in

Don't you dare go Hollow

virtual_pointer: fix multiplier for axis_discrete (#2684)

Browse files at this commit

08fbdef60e17f57afd627a97060d33ef0ebd9da7UnverifiedFerdinand SchoberParent: aecbd67
The virtual-pointer protocol accepts discrete scroll events, not axis-value120.
Therefore the value received from a client must be multiplied by 120 before
being handed to mutate_axis_frame.

https://gitlab.freedesktop.org/wlroots/wlroots/-/blob/879243e370de6167d2c49510396f937b1a93fab5/types/wlr_virtual_pointer_v1.c#L183
https://github.com/feschber/lan-mouse/issues/318
https://github.com/feschber/lan-mouse/pull/325
https://github.com/feschber/lan-mouse/issues/329
src/protocols/virtual_pointer.rsmodified+1 -1
@@ -519,7 +519,7 @@ where
519 }519 }
520 };520 };
521 pointer.mutate_axis_frame(Some(time), |frame| {521 pointer.mutate_axis_frame(Some(time), |frame| {
522- frame.value(axis, value).v120(axis, discrete)522+ frame.value(axis, value).v120(axis, discrete * 120)
523 });523 });
524 }524 }
525 zwlr_virtual_pointer_v1::Request::Destroy => {}525 zwlr_virtual_pointer_v1::Request::Destroy => {}