touchpad: Make tap code follow state machine diagram part 1
authorHans de Goede <hdegoede@redhat.com>
Thu, 6 Nov 2014 10:15:27 +0000 (11:15 +0100)
committerHans de Goede <hdegoede@redhat.com>
Thu, 6 Nov 2014 10:18:29 +0000 (11:18 +0100)
commit7a64815faa82014f7c45d764170541e0d1773d4d
tree1a0731948a8e9522a5b62af3becc97489a49fbff
parent6699d1b637e67780fb5034e2648f492a8440b21b
touchpad: Make tap code follow state machine diagram part 1

According to the diagram, we should only check the tap-touch-state before
sending a button press / release when in state touch_2 or touch_3.

tp_tap_notify always checks the tap-touch-state. This is problematic when in
state tapped, or one of the follow up states, since this could cause the
button 1 release to never happen.

In practice this is never a problem since the touch passed into tp_tap_notify
is NULL when called for timeout or button events, and in the 2 affected paths
where we're dealing with a touch or release tap-touch-state always is
TAP_TOUCH_STATE_TOUCH.

However we should not rely on this and properly follow the diagram, this
commit therefor drops the touch argument to tp_tap_notify, and adds explicit
tap-touch-state checks in the places where they are present in the diagram too.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
src/evdev-mt-touchpad-tap.c