touchpad: Switch to smooth simple acceleration code from filter.c
authorHans de Goede <hdegoede@redhat.com>
Tue, 1 Jul 2014 12:53:18 +0000 (14:53 +0200)
committerPeter Hutterer <peter.hutterer@who-t.net>
Wed, 2 Jul 2014 04:20:26 +0000 (14:20 +1000)
commitbb3edf4c940e66bf5064be61fea0857aa623d58d
tree96738b72849b26af0eb28a6c852d639b712f0c39
parent6b6f24ee1c77399c6e8dffae80cff2ec35ca3e73
touchpad: Switch to smooth simple acceleration code from filter.c

The old touchpad accel code was clamping touchpad acceleration between
0.2 and 0.4, and on the test devices I have the constant_factor ended up
such that in practice the accel was almost always 0.2, so rather than having
a velocity based acceleration curve, in essence it was just always using an
acceleration of 0.2 .

This commit introduces actual velocity based acceleration based on the
recently added smooth simple acceleration code from filter.c .

Before feeding motion events to filter.c, they first get adjusted for touchpad
resolution. For touchpads where the driver does not provide resolution info,
scale based on the diagonal-size in units instead.

While at it rename tp_init_accel's dispatch parameter from touchpad to tp
to be consistent with all other functions.

Since the acceleration is also used for scrolling also adjust the scroll
start threshold for these changes.

Note that switching to the smooth simple accel code, as an added bonus gives
the tp code an accel profile with a threshold and a speed parameter, which
is exactly what is needed for the upcoming configuration interface support.

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