touchpad: don't disable tapping on MT_TOOL_PALM

The tapping code can handle palm states now, so there is no need to disable
tapping altogether when a tool-based palm is detected.

Fixes https://gitlab.freedesktop.org/libinput/libinput/issues/65

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2018-06-25 14:50:22 +10:00
parent b049d6696d
commit 237ebb7cc4
2 changed files with 43 additions and 3 deletions

View file

@ -842,9 +842,6 @@ tp_palm_detect_tool_triggered(struct tp_dispatch *tp,
!t->is_tool_palm)
t->palm.state = PALM_NONE;
if (t->palm.state == PALM_TOOL_PALM)
tp_stop_actions(tp, time);
return t->palm.state == PALM_TOOL_PALM;
}

View file

@ -1541,6 +1541,48 @@ START_TEST(touchpad_palm_detect_tool_palm_on_off)
}
END_TEST
START_TEST(touchpad_palm_detect_tool_palm_tap_after)
{
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
if (!touchpad_has_tool_palm(dev))
return;
litest_enable_tap(dev->libinput_device);
litest_drain_events(li);
litest_push_event_frame(dev);
litest_event(dev, EV_ABS, ABS_MT_TOOL_TYPE, MT_TOOL_PALM);
litest_touch_down(dev, 0, 50, 50);
litest_pop_event_frame(dev);
libinput_dispatch(li);
litest_touch_move_to(dev, 0, 50, 50, 50, 80, 10, 0);
libinput_dispatch(li);
litest_assert_empty_queue(li);
litest_push_event_frame(dev);
litest_event(dev, EV_ABS, ABS_MT_TOOL_TYPE, MT_TOOL_FINGER);
litest_touch_up(dev, 0);
litest_pop_event_frame(dev);
libinput_dispatch(li);
litest_timeout_tap();
litest_assert_empty_queue(li);
litest_touch_down(dev, 0, 50, 50);
libinput_dispatch(li);
litest_touch_up(dev, 0);
libinput_dispatch(li);
litest_timeout_tap();
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_PRESSED);
litest_assert_button_event(li, BTN_LEFT, LIBINPUT_BUTTON_STATE_RELEASED);
litest_assert_empty_queue(li);
}
END_TEST
START_TEST(touchpad_palm_detect_tool_palm_tap)
{
struct litest_device *dev = litest_current_device();
@ -6336,6 +6378,7 @@ TEST_COLLECTION(touchpad)
litest_add("touchpad:palm", touchpad_palm_detect_tool_palm, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH);
litest_add("touchpad:palm", touchpad_palm_detect_tool_palm_on_off, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH);
litest_add("touchpad:palm", touchpad_palm_detect_tool_palm_tap, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH);
litest_add("touchpad:palm", touchpad_palm_detect_tool_palm_tap_after, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH);
litest_add("touchpad:palm", touchpad_palm_detect_touch_size, LITEST_APPLE_CLICKPAD, LITEST_ANY);
litest_add("touchpad:palm", touchpad_palm_detect_pressure, LITEST_TOUCHPAD, LITEST_SINGLE_TOUCH);