wheel: ignore initial small scroll deltas
authorJosé Expósito <jose.exposito89@gmail.com>
Wed, 29 Sep 2021 16:32:54 +0000 (18:32 +0200)
committerJosé Expósito <jose.exposito89@gmail.com>
Mon, 8 Nov 2021 17:00:46 +0000 (18:00 +0100)
commitb6a944bb80a9bb886bf38508e8a2b85be22dda57
tree7d14f4fb03554544d66bda9cdc88f2f847025607
parent08245c778a8ff0e92b50266b9712174bbf4d9e32
wheel: ignore initial small scroll deltas

Mice with high-resolution support can generate deltas when the finger is
put on the wheel or when the user tries to click the wheel.

To avoid sending involuntary scroll events, add an extra state the the
wheel state machine to accumulate scroll deltas.
While the accumulated scroll is lower than a certain threshold, ignore
them until the threshold is reached.

Since no finish event is sent by the mouse, reset the state machine
after a period of scroll inactivity.

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
src/evdev-fallback.c
src/evdev-fallback.h
src/evdev-wheel.c
test/litest.c
test/litest.h
test/test-pointer.c