mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-02-04 04:40:25 +01:00
touchpad: disable right-edge palm detection for edge scrolling
Most scroll motions would be labelled a palm. https://bugs.freedesktop.org/show_bug.cgi?id=90980 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
parent
9c2afae146
commit
51b694e282
4 changed files with 28 additions and 1 deletions
|
|
@ -75,7 +75,7 @@ edge_event_to_str(enum scroll_event event)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static uint32_t
|
||||
uint32_t
|
||||
tp_touch_get_edge(struct tp_dispatch *tp, struct tp_touch *t)
|
||||
{
|
||||
uint32_t edge = EDGE_NONE;
|
||||
|
|
|
|||
|
|
@ -558,6 +558,9 @@ tp_palm_detect(struct tp_dispatch *tp, struct tp_touch *t, uint64_t time)
|
|||
tp_button_is_inside_softbutton_area(tp, t))
|
||||
return;
|
||||
|
||||
if (tp_touch_get_edge(tp, t) & EDGE_RIGHT)
|
||||
return;
|
||||
|
||||
t->palm.state = PALM_EDGE;
|
||||
t->palm.time = time;
|
||||
t->palm.first = t->point;
|
||||
|
|
|
|||
|
|
@ -399,6 +399,9 @@ tp_edge_scroll_stop_events(struct tp_dispatch *tp, uint64_t time);
|
|||
int
|
||||
tp_edge_scroll_touch_active(struct tp_dispatch *tp, struct tp_touch *t);
|
||||
|
||||
uint32_t
|
||||
tp_touch_get_edge(struct tp_dispatch *tp, struct tp_touch *t);
|
||||
|
||||
int
|
||||
tp_init_gesture(struct tp_dispatch *tp);
|
||||
|
||||
|
|
|
|||
|
|
@ -1692,6 +1692,26 @@ START_TEST(touchpad_palm_detect_at_edge)
|
|||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(touchpad_no_palm_detect_at_edge_for_edge_scrolling)
|
||||
{
|
||||
struct litest_device *dev = litest_current_device();
|
||||
struct libinput *li = dev->libinput;
|
||||
|
||||
if (!touchpad_has_palm_detect_size(dev))
|
||||
return;
|
||||
|
||||
enable_edge_scroll(dev);
|
||||
|
||||
litest_drain_events(li);
|
||||
|
||||
litest_touch_down(dev, 0, 99, 50);
|
||||
litest_touch_move_to(dev, 0, 99, 50, 99, 70, 5, 0);
|
||||
litest_touch_up(dev, 0);
|
||||
|
||||
litest_assert_only_typed_events(li, LIBINPUT_EVENT_POINTER_AXIS);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(touchpad_palm_detect_at_bottom_corners)
|
||||
{
|
||||
struct litest_device *dev = litest_current_device();
|
||||
|
|
@ -3543,6 +3563,7 @@ litest_setup_tests(void)
|
|||
litest_add("touchpad:palm", touchpad_palm_detect_palm_stays_palm, LITEST_TOUCHPAD, LITEST_ANY);
|
||||
litest_add("touchpad:palm", touchpad_palm_detect_no_palm_moving_into_edges, LITEST_TOUCHPAD, LITEST_ANY);
|
||||
litest_add("touchpad:palm", touchpad_palm_detect_tap, LITEST_TOUCHPAD, LITEST_ANY);
|
||||
litest_add("touchpad:palm", touchpad_no_palm_detect_at_edge_for_edge_scrolling, LITEST_TOUCHPAD, LITEST_CLICKPAD);
|
||||
|
||||
litest_add("touchpad:left-handed", touchpad_left_handed, LITEST_TOUCHPAD|LITEST_BUTTON, LITEST_CLICKPAD);
|
||||
litest_add("touchpad:left-handed", touchpad_left_handed_clickpad, LITEST_CLICKPAD, LITEST_APPLE_CLICKPAD);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue