summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatt Mayfield <mdmayfield@users.noreply.github.com>2018-08-21 21:12:33 -0500
committerPeter Hutterer <peter.hutterer@who-t.net>2019-07-15 13:08:47 +1000
commite97f0549173a07aa6ebd19ca19f842b8d3ac994c (patch)
tree75ac1acf4fe4f8c086d239e6e7412f59fe9752a1 /src
parent7b9a6a94a37cc659d3888c4de25deaca9bd4bed6 (diff)
gestures: improve scroll responsiveness for vertically aligned touches
Put some basic location checks in, if the fingers are next to each other and vertically close, assume scroll over swipe. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>:
Diffstat (limited to 'src')
-rw-r--r--src/evdev-mt-touchpad-gestures.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/evdev-mt-touchpad-gestures.c b/src/evdev-mt-touchpad-gestures.c
index d4133b52..12e00a3f 100644
--- a/src/evdev-mt-touchpad-gestures.c
+++ b/src/evdev-mt-touchpad-gestures.c
@@ -496,6 +496,17 @@ tp_gesture_handle_state_unknown(struct tp_dispatch *tp, uint64_t time)
if (first_mm < 1 && second_mm < 1)
return GESTURE_STATE_UNKNOWN;
+ /* If both touches are within 7mm vertically and 40mm horizontally,
+ * assume scroll/swipe */
+ if (distance_mm.x < 40 && distance_mm.y < 7.0) {
+ if (tp->gesture.finger_count == 2) {
+ tp_gesture_set_scroll_buildup(tp);
+ return GESTURE_STATE_SCROLL;
+ } else if (tp->gesture.enabled) {
+ return GESTURE_STATE_SWIPE;
+ }
+ }
+
/* If one touch exceeds the outer threshold while the other has not
* yet passed the inner threshold, this is not a valid gesture.
* If thumb detection is enabled, and one of the touches is >20mm