[PATCH libinput 1/2] touchpad: reduce 2fg scroll threshold to 2mm
Peter Hutterer
peter.hutterer at who-t.net
Tue Jul 21 00:20:03 PDT 2015
3mm is too large, especially on fine-grained scroll motions. Since we
already use the hysteresis to defuzz the current touchpad point, having a
slower threshold here should not cause any adverse motions.
This affects the pinch gestures too and needs a minor test adjustment. The
atmel hover device's resolution is low enough that we trigger a >1 degree
angle now, make the movement a bit more finegrained.
https://bugs.freedesktop.org/show_bug.cgi?id=91364
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
src/evdev-mt-touchpad-gestures.c | 3 ++-
test/gestures.c | 10 +++++-----
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/src/evdev-mt-touchpad-gestures.c b/src/evdev-mt-touchpad-gestures.c
index a23b5ce..a7231eb 100644
--- a/src/evdev-mt-touchpad-gestures.c
+++ b/src/evdev-mt-touchpad-gestures.c
@@ -195,9 +195,10 @@ tp_gesture_get_direction(struct tp_dispatch *tp, struct tp_touch *touch)
if (tp->semi_mt)
move_threshold = TP_MM_TO_DPI_NORMALIZED(4);
else
- move_threshold = TP_MM_TO_DPI_NORMALIZED(3);
+ move_threshold = TP_MM_TO_DPI_NORMALIZED(2);
delta = device_delta(touch->point, touch->gesture.initial);
+
normalized = tp_normalize_delta(tp, delta);
if (normalized_length(normalized) < move_threshold)
diff --git a/test/gestures.c b/test/gestures.c
index 8b6639f..b9d7325 100644
--- a/test/gestures.c
+++ b/test/gestures.c
@@ -287,16 +287,16 @@ START_TEST(gestures_spread)
litest_touch_down(dev, 1, 50 - dir_x, 50 - dir_y);
libinput_dispatch(li);
- for (i = 0; i < 8; i++) {
+ for (i = 0; i < 15; i++) {
litest_push_event_frame(dev);
if (dir_x > 0.0)
- dir_x += 3;
+ dir_x += 2;
else if (dir_x < 0.0)
- dir_x -= 3;
+ dir_x -= 2;
if (dir_y > 0.0)
- dir_y += 3;
+ dir_y += 2;
else if (dir_y < 0.0)
- dir_y -= 3;
+ dir_y -= 2;
litest_touch_move(dev,
0,
50 + dir_x,
--
2.4.3
More information about the wayland-devel
mailing list