diff options
author | Hans de Goede <hdegoede@redhat.com> | 2014-09-25 15:58:04 +0200 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2014-11-06 11:04:17 +0100 |
commit | 23031c8fd70a98ef32a80ded6299010ea5e732c2 (patch) | |
tree | 8238d4866d6cad0a9ebadf514205bfbe3072e6a8 /test | |
parent | 83fb3a89bedae6761963e083ed7067b45b3362cb (diff) | |
download | libinput-23031c8fd70a98ef32a80ded6299010ea5e732c2.tar.gz |
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>
Diffstat (limited to 'test')
-rw-r--r-- | test/touchpad.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/test/touchpad.c b/test/touchpad.c index 8bd09f19..fba1d58b 100644 --- a/test/touchpad.c +++ b/test/touchpad.c @@ -200,6 +200,45 @@ START_TEST(touchpad_1fg_tap_n_drag_timeout) } END_TEST +START_TEST(touchpad_2fg_tap_n_drag) +{ + struct litest_device *dev = litest_current_device(); + struct libinput *li = dev->libinput; + struct libinput_event *event; + + 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); + litest_touch_down(dev, 1, 60, 50); + litest_touch_move_to(dev, 0, 50, 50, 80, 80, 5, 40); + libinput_dispatch(li); + + litest_assert_button_event(li, BTN_LEFT, + LIBINPUT_BUTTON_STATE_PRESSED); + + while (libinput_next_event_type(li) == LIBINPUT_EVENT_POINTER_MOTION) { + event = libinput_get_event(li); + libinput_event_destroy(event); + libinput_dispatch(li); + } + litest_assert_empty_queue(li); + + litest_touch_up(dev, 0); + litest_touch_up(dev, 1); + + /* This will wait for the DRAGGING_WAIT timeout */ + 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(); @@ -1934,6 +1973,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_n_drag, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH); 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); |