summaryrefslogtreecommitdiff
path: root/src/evdev-mt-touchpad-thumb.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2019-09-19 12:51:10 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2019-09-25 04:10:02 +0000
commit0ce06d131499f9d3588f97263dea2e004ce5bbcd (patch)
tree600d6f0fcb89d65f37f0d9fc0ff1fbe387594743 /src/evdev-mt-touchpad-thumb.c
parentd4ede2256c1023dbb9eaaa1fb9a5a70aff4def14 (diff)
downloadlibinput-0ce06d131499f9d3588f97263dea2e004ce5bbcd.tar.gz
touchpad: only identify for pinch in a distinct pinch position
Previously, any lower finger spaced more than the vertical threshold apart would be labelled as thumb. This causes some taps to be detected as single-taps, particularly where the user's hand is at an angle that causes the touches to be effectively vertical. Restructure that condition so that we only go for a thumb if we're distinctively apart, and we only *not* go for thumb if we're distinctively close together. Fixes #359 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src/evdev-mt-touchpad-thumb.c')
-rw-r--r--src/evdev-mt-touchpad-thumb.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/evdev-mt-touchpad-thumb.c b/src/evdev-mt-touchpad-thumb.c
index 103cf58a..3d9f9991 100644
--- a/src/evdev-mt-touchpad-thumb.c
+++ b/src/evdev-mt-touchpad-thumb.c
@@ -332,15 +332,18 @@ tp_thumb_update_multifinger(struct tp_dispatch *tp)
/* Position-based thumb detection: When a new touch arrives, check the
* two lowest touches. If they qualify for 2-finger scrolling, clear
- * thumb status. If not, mark the lower touch (based on pinch_eligible)
- * as either PINCH or SUPPRESSED.
+ * thumb status.
+ *
+ * If they were in distinct diagonal position, then mark the lower
+ * touch (based on pinch_eligible) as either PINCH or SUPPRESSED. If
+ * we're too close together for a thumb, lift that.
*/
- if (mm.y > SCROLL_MM_Y) {
+ if (mm.y > SCROLL_MM_Y && mm.x > SCROLL_MM_X) {
if (tp->thumb.pinch_eligible)
tp_thumb_pinch(tp, first);
else
tp_thumb_suppress(tp, first);
- } else {
+ } else if (mm.x < SCROLL_MM_X && mm.y < SCROLL_MM_Y) {
tp_thumb_lift(tp);
}
}