touchpad: restart the motion filter on touch begin
authorPeter Hutterer <peter.hutterer@who-t.net>
Tue, 9 Jun 2015 23:54:06 +0000 (09:54 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Wed, 10 Jun 2015 21:19:25 +0000 (07:19 +1000)
commit105e725602791bd02ea800fd4298d3443c14ba58
treee3fd4b00d85a8c4b572d01036d3e26c32621ea57
parentd698f1b12fdf6a2fcc0103f338b944e3e6762c0b
touchpad: restart the motion filter on touch begin

Our motion filter takes the last couple of vectors to calculate speed,
provided the direction stays the same and it is within a certain timeout. It
does not take into account lifting the finger, so the velocity on the first
event is off.

Real-world impact is mainly on scrolling. Before commit 289e4675
filter: enforce minimum velocity
the first motion on a scroll was accelerated by a factor of 0 and swallowed.
After 289e4675 the motion was calculated based on the timeout and a fraction
of the expected effect. Now the first scroll motion is based on the real
finger motion since setting the finger down and thus feels a bit more
responsive.

It also makes a couple of test cases using litest_assert_scroll() work again
since the miniumum motion is now as expected.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
src/evdev-mt-touchpad.c
src/filter-private.h
src/filter.c
src/filter.h