diff --git a/src/evdev-mt-touchpad-gestures.c b/src/evdev-mt-touchpad-gestures.c index d332186b..57c07feb 100644 --- a/src/evdev-mt-touchpad-gestures.c +++ b/src/evdev-mt-touchpad-gestures.c @@ -113,7 +113,17 @@ tp_gesture_post_twofinger_scroll(struct tp_dispatch *tp, uint64_t time) if (tp->scroll.method != LIBINPUT_CONFIG_SCROLL_2FG) return; - delta = tp_get_average_touches_delta(tp); + /* On some semi-mt models slot 0 is more accurate, so for semi-mt + * we only use slot 0. */ + if (tp->semi_mt) { + if (!tp->touches[0].dirty) + return; + + delta = tp_get_delta(&tp->touches[0]); + } else { + delta = tp_get_average_touches_delta(tp); + } + delta = tp_filter_motion(tp, &delta, time); if (normalized_is_zero(delta)) diff --git a/test/touchpad.c b/test/touchpad.c index db981dcb..35842689 100644 --- a/test/touchpad.c +++ b/test/touchpad.c @@ -2464,7 +2464,7 @@ test_2fg_scroll(struct litest_device *dev, double dx, double dy, int want_sleep) litest_touch_down(dev, 0, 49, 50); litest_touch_down(dev, 1, 51, 50); - litest_touch_move_two_touches(dev, 49, 50, 51, 50, dx, dy, 5, 0); + litest_touch_move_two_touches(dev, 49, 50, 51, 50, dx, dy, 10, 0); /* Avoid a small scroll being seen as a tap */ if (want_sleep) {