gestures: Filter unaccelerated deltas for gestures
authorAlexander Mikhaylenko <exalm7659@gmail.com>
Mon, 1 Mar 2021 16:09:37 +0000 (21:09 +0500)
committerPeter Hutterer <peter.hutterer@who-t.net>
Tue, 16 Mar 2021 21:29:56 +0000 (21:29 +0000)
commit60d5172e15728cc25db889a7a6bcf37a06a15a3a
tree5166fc6498dbdc757a038dcb16f7531f5102246f
parent1d9cdf76a566a5e95f23aba5d85840163b0f6e5f
gestures: Filter unaccelerated deltas for gestures

Make sure the unaccelerated deltas are comparable to scroll deltas.

edit by whot:
The original intention of the unaccelerated motion data here was to provide
both accelerated and unaccelerated motion for gestures so it was possible to
have 1:1 mapping from gesture motion to screen activity.

Normalizing to 1000dpi this way would've worked for mice but touchpad
acceleration also includes the TP_MAGIC_SLOWDOWN (amongst other tricks) which
slows down motion to around 27% *before* applying the acceleration function.
On a 1000dpi touchpad (~40 units/mm) simply normalizing touchpad motion to
1000dpi results in pointer motion that is way too fast, it's lacking that
slowdown to 27% of original speed.

This results in the accelerated and unaccelerated gesture data being in
effectively two different coordinate systems with the caller having no ability
to relate the two.

Switching to the special constant acceleration applies that slowdown and
matches the data to the part of the acceleration curve where no (additional)
acceleration is applied.

It makes the gesture unaccelerated data comparable to the accelerated data
and to scroll data which uses the same process.

Fixes #582

Signed-off-by: Alexander Mikhaylenko <alexm@gnome.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
src/evdev-mt-touchpad-gestures.c