summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2018-10-15 14:45:06 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2018-10-15 14:46:53 +1000
commit12dc64af243950a1344084563198042f7dd3fe25 (patch)
treebb60556c17bbe919fbf66350b21b448818bd93c4 /test
parent782bbdb231532e363a57e73f42529a5b23164cba (diff)
touchpad: handle a touch ending and restarting in the same frame
If a touch ends and starts again in the same frame, our touch count gets out of whack. This later triggers an assertion when the tap touch count mismatches the real tap count. E: 0.105005 0003 0039 -001 # EV_ABS / ABS_MT_TRACKING_ID -1 E: 0.105005 0003 0035 8447 # EV_ABS / ABS_MT_POSITION_X 8447 E: 0.105005 0003 0036 4479 # EV_ABS / ABS_MT_POSITION_Y 4479 E: 0.105005 0001 014a 0000 # EV_KEY / BTN_TOUCH 0 E: 0.105005 0001 0145 0000 # EV_KEY / BTN_TOOL_FINGER 0 E: 0.105005 0003 0039 0074 # EV_ABS / ABS_MT_TRACKING_ID 74 E: 0.105005 0003 0035 8388 # EV_ABS / ABS_MT_POSITION_X 8388 E: 0.105005 0003 0036 4480 # EV_ABS / ABS_MT_POSITION_Y 4480 E: 0.105005 0001 014a 0001 # EV_KEY / BTN_TOUCH 1 E: 0.105005 0001 0145 0001 # EV_KEY / BTN_TOOL_FINGER 1 E: 0.105005 0003 0000 8388 # EV_ABS / ABS_X 8388 E: 0.105005 0003 0001 4480 # EV_ABS / ABS_Y 4480 E: 0.105005 0000 0000 0000 # ------------ SYN_REPORT (0) ---------- +19ms This is a kernel bug but let's paper over here because otherwise we crash and that's considered impolite. Fixes #161 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'test')
-rw-r--r--test/test-touchpad.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/test/test-touchpad.c b/test/test-touchpad.c
index 4f119844..fcb910a3 100644
--- a/test/test-touchpad.c
+++ b/test/test-touchpad.c
@@ -6732,6 +6732,40 @@ out:
}
END_TEST
+START_TEST(touchpad_end_start_touch)
+{
+ struct litest_device *dev = litest_current_device();
+ struct libinput *li = dev->libinput;
+
+ litest_enable_tap(dev->libinput_device);
+
+ litest_drain_events(li);
+
+ litest_touch_down(dev, 0, 50, 50);
+ litest_touch_move(dev, 0, 50.1, 50.1);
+ libinput_dispatch(li);
+
+ litest_push_event_frame(dev);
+ litest_touch_up(dev, 0);
+ litest_touch_down(dev, 0, 50.2, 50.2);
+ litest_pop_event_frame(dev);
+
+ litest_disable_log_handler(li);
+ libinput_dispatch(li);
+ litest_restore_log_handler(li);
+
+ litest_assert_empty_queue(li);
+
+ litest_timeout_tap();
+ libinput_dispatch(li);
+
+ litest_touch_move_to(dev, 0, 50.2, 50.2, 50, 70, 10);
+ litest_touch_up(dev, 0);
+
+ litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_MOTION);
+}
+END_TEST
+
TEST_COLLECTION(touchpad)
{
struct range suspends = { SUSPEND_EXT_MOUSE, SUSPEND_COUNT };
@@ -6928,4 +6962,8 @@ TEST_COLLECTION(touchpad)
litest_add_ranged("touchpad:suspend", touchpad_suspend_abba, LITEST_TOUCHPAD, LITEST_ANY, &suspends);
litest_add_ranged("touchpad:suspend", touchpad_suspend_abab, LITEST_TOUCHPAD, LITEST_ANY, &suspends);
+
+ /* Happens on the "Wacom Intuos Pro M Finger" but our test device
+ * has the same properties */
+ litest_add_for_device("touchpad:bugs", touchpad_end_start_touch, LITEST_WACOM_FINGER);
}