mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-05-08 22:58:11 +02:00
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>
This commit is contained in:
parent
d4ede2256c
commit
0ce06d1314
1 changed files with 7 additions and 4 deletions
|
|
@ -332,15 +332,18 @@ tp_thumb_update_multifinger(struct tp_dispatch *tp)
|
||||||
|
|
||||||
/* Position-based thumb detection: When a new touch arrives, check the
|
/* Position-based thumb detection: When a new touch arrives, check the
|
||||||
* two lowest touches. If they qualify for 2-finger scrolling, clear
|
* two lowest touches. If they qualify for 2-finger scrolling, clear
|
||||||
* thumb status. If not, mark the lower touch (based on pinch_eligible)
|
* thumb status.
|
||||||
* as either PINCH or SUPPRESSED.
|
*
|
||||||
|
* 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)
|
if (tp->thumb.pinch_eligible)
|
||||||
tp_thumb_pinch(tp, first);
|
tp_thumb_pinch(tp, first);
|
||||||
else
|
else
|
||||||
tp_thumb_suppress(tp, first);
|
tp_thumb_suppress(tp, first);
|
||||||
} else {
|
} else if (mm.x < SCROLL_MM_X && mm.y < SCROLL_MM_Y) {
|
||||||
tp_thumb_lift(tp);
|
tp_thumb_lift(tp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue