Improve disambiguation between two-finger pinch and scroll
authornovenary <streetwalkermc@gmail.com>
Sun, 4 Apr 2021 15:30:41 +0000 (18:30 +0300)
committerPeter Hutterer <peter.hutterer@who-t.net>
Wed, 19 May 2021 05:12:58 +0000 (05:12 +0000)
commit939a022cbc8e5c17901646fc2c33b1d1f81e4d9d
tree24fb397a3b5cd281b9fa9a21c3371a52756367c3
parent3dcfae3fb699bc72c34099f5a567a61e075971b5
Improve disambiguation between two-finger pinch and scroll

A pinch is defined as two fingers moving in different directions, and a
scroll as two fingers moving in the same direction.

Often enough when the user is trying to pinch, we may initially see both
fingers moving in the same direction and decide that they want to
scroll.

Add a grace period during which we may transition to a pinch in those
situations.

Test fix: touchpad_trackpoint_buttons_2fg_scroll emits movements that
change the distance between fingers, which triggers this new transition
and makes the test fail; correct this.

Signed-off-by: novenary <streetwalkermc@gmail.com>
src/evdev-mt-touchpad-gestures.c
test/test-touchpad.c