diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2014-09-03 11:16:20 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2014-09-18 11:30:15 +1000 |
commit | 504c7667e90454834d65a29cb592e36f4f51ae99 (patch) | |
tree | 85045518fe84319c0dc7b81e9970080aae99848c /test | |
parent | fca1519395195cc767024513574fb27597fa0733 (diff) | |
download | libinput-504c7667e90454834d65a29cb592e36f4f51ae99.tar.gz |
touchpad: fix tap-and-drag handling for timeouts
Doing a tap-and-drag gesture but just holding the finger instead of moving
should trigger a timeout and still switchin into tap-and-drag.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/touchpad.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/touchpad.c b/test/touchpad.c index eecbf20a..7ff3d142 100644 --- a/test/touchpad.c +++ b/test/touchpad.c @@ -171,6 +171,35 @@ START_TEST(touchpad_1fg_tap_n_drag) } END_TEST +START_TEST(touchpad_1fg_tap_n_drag_timeout) +{ + struct litest_device *dev = litest_current_device(); + struct libinput *li = dev->libinput; + + libinput_device_config_tap_set_enabled(dev->libinput_device, + LIBINPUT_CONFIG_TAP_ENABLED); + + litest_drain_events(li); + + litest_touch_down(dev, 0, 50, 50); + litest_touch_up(dev, 0); + litest_touch_down(dev, 0, 50, 50); + libinput_dispatch(li); + msleep(300); + + litest_assert_button_event(li, BTN_LEFT, + LIBINPUT_BUTTON_STATE_PRESSED); + + litest_assert_empty_queue(li); + litest_touch_up(dev, 0); + + litest_assert_button_event(li, BTN_LEFT, + LIBINPUT_BUTTON_STATE_RELEASED); + + litest_assert_empty_queue(li); +} +END_TEST + START_TEST(touchpad_2fg_tap) { struct litest_device *dev = litest_current_device(); @@ -1601,6 +1630,7 @@ int main(int argc, char **argv) { litest_add("touchpad:tap", touchpad_1fg_tap, LITEST_TOUCHPAD, LITEST_ANY); litest_add("touchpad:tap", touchpad_1fg_tap_n_drag, LITEST_TOUCHPAD, LITEST_ANY); + litest_add("touchpad:tap", touchpad_1fg_tap_n_drag_timeout, LITEST_TOUCHPAD, LITEST_ANY); litest_add("touchpad:tap", touchpad_2fg_tap, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH); litest_add("touchpad:tap", touchpad_2fg_tap_inverted, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH); litest_add("touchpad:tap", touchpad_1fg_tap_click, LITEST_TOUCHPAD, LITEST_CLICKPAD); |