summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2019-06-20 21:25:25 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2019-07-15 13:08:47 +1000
commit1dae79c833c202d7b6782b63fe295027450b0ebe (patch)
tree22784a1acc830b4757a37debbc7d40e5ac16313f
parent93ab2f964a29965b36dd0467ab8ffb44e75b6637 (diff)
downloadlibinput-1dae79c833c202d7b6782b63fe295027450b0ebe.tar.gz
gestures: fast-track scroll/swipe detection when gestures are off
We can't detect pinch when gestures are off anyway, so we don't need to check the finger distances. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/evdev-mt-touchpad-gestures.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/evdev-mt-touchpad-gestures.c b/src/evdev-mt-touchpad-gestures.c
index e13fb3da..a3f18dcd 100644
--- a/src/evdev-mt-touchpad-gestures.c
+++ b/src/evdev-mt-touchpad-gestures.c
@@ -499,12 +499,13 @@ tp_gesture_handle_state_unknown(struct tp_dispatch *tp, uint64_t time)
/* If both touches are within 7mm vertically and 40mm horizontally
* past the timeout, assume scroll/swipe */
- if (distance_mm.x < 40.0 && distance_mm.y < 7.0 &&
+ if ((!tp->gesture.enabled ||
+ (distance_mm.x < 40.0 && distance_mm.y < 7.0)) &&
time > (tp->gesture.initial_time + DEFAULT_GESTURE_SWIPE_TIMEOUT)) {
if (tp->gesture.finger_count == 2) {
tp_gesture_set_scroll_buildup(tp);
return GESTURE_STATE_SCROLL;
- } else if (tp->gesture.enabled) {
+ } else {
return GESTURE_STATE_SWIPE;
}
}