touchpad: Avoid spurious motion event for scroll movement below threshold
authorHans de Goede <hdegoede@redhat.com>
Tue, 24 Jun 2014 14:23:10 +0000 (16:23 +0200)
committerPeter Hutterer <peter.hutterer@who-t.net>
Wed, 25 Jun 2014 01:11:39 +0000 (11:11 +1000)
commitc0af1b57d4063f0894ade2ba2f57a149ad454f7f
tree74930062e2931b797a8219ad34291f8915da48e5
parentc9a01969d8e5ad527fede479be0b032a46a4f18d
touchpad: Avoid spurious motion event for scroll movement below threshold

If the user puts down to fingers to scroll, then changes his mind and
lifts them, without having them moved past the initial scroll threshold in
either direction, then any movement which he has done will cause a spurious
scroll event when the second finger down is lifted first.

The problem is that t->is_pointer was not being set to false in this case,
since that is done in tp_post_twofinger_scroll after checking scroll.state
which never gets set in this scenario.

Instead of changing the order, simply completely remove scroll.state completely
it is a boolean, and everywhere we check for it we also check for the axis bits
in state.direction, so it is not necessary.

Also add a check to ensure there are no spurious motion events.

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
test/touchpad.c