litest: Add a sleep_ms parameter to litest_touch_move_to

In reality moving a touch from point to another takes time. In some cases
(when a timeout may trigger during the move, e.g. tap-n-drag on a touchpad),
this is important. Add a sleep_ms parameter, which will cause
litest_touch_move_to to sleep the specified amount of ms every step.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
touchpad: Make motion during tap-n-drag test take some time

The tap code will move individual touches to a state of TAP_TOUCH_STATE_DEAD
after a timeout. In case of tap-n-drag this should not have any influence,
make the litest_touch_move_to take long enough to trigger the timeout to
verify that this does not has any influence.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
touchpad: Don't send scroll events during 2 finger tap-n-drag

The touchpad tap code explicitly supports 2 finger tap-n-drag, this commit
adds a test-case for this, which fails due to the 2 finger scrolling code
sending scroll events during a 2 finger tap-n-drag.

And this commit fixes the test-case, by not sending scroll events while a
tap-n-drag is active.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
touchpad: Add a test for 2fg tap-n-drag release on a 3th finger down

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
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>
touchpad: Make tap code follow state machine diagram part 2

Mark touches as idle, rather then dead, on release. This causes no functional
changes since we only evert check for tap-touch-state == touch, and neither
being idle or dead == touch.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
touchpad: Make tap code follow state machine diagram part 3

We should only mark touches dead on a button click if we're dealing with a
clickpad.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Merge branch 'for-peter' of git://people.freedesktop.org/~jwrdegoede/libinput