touchpad: only check for vertical finger distribution on 2fg gestures

A natural hand position for a 4-finger swipe will have one finger well below
the other triggering the pinch detection. This is obviously wrong, only do the
finger position analysis when we have 2 fingers.

This is only a partial fix, for 3-4 finger gestures chances are high that the
third/fourth finger come in a different event frame. Before that we likely
detect 2 fingers in a possible pinch position and still trigger the code path.
This issue has to be fixed separately.

https://bugs.freedesktop.org/show_bug.cgi?id=96687

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
Peter Hutterer 2016-06-28 15:25:42 +10:00
parent 0926f570c4
commit 11917061fe

View file

@ -330,8 +330,8 @@ tp_gesture_handle_state_unknown(struct tp_dispatch *tp, uint64_t time)
/* for two-finger gestures, if the fingers stay unmoving for a /* for two-finger gestures, if the fingers stay unmoving for a
* while, assume (slow) scroll */ * while, assume (slow) scroll */
if (tp->gesture.finger_count == 2 && if (tp->gesture.finger_count == 2) {
time > (tp->gesture.initial_time + DEFAULT_GESTURE_2FG_SCROLL_TIMEOUT)) { if (time > (tp->gesture.initial_time + DEFAULT_GESTURE_2FG_SCROLL_TIMEOUT)) {
tp_gesture_set_scroll_buildup(tp); tp_gesture_set_scroll_buildup(tp);
return GESTURE_STATE_SCROLL; return GESTURE_STATE_SCROLL;
} }
@ -344,6 +344,7 @@ tp_gesture_handle_state_unknown(struct tp_dispatch *tp, uint64_t time)
tp_gesture_init_pinch(tp); tp_gesture_init_pinch(tp);
return GESTURE_STATE_PINCH; return GESTURE_STATE_PINCH;
} }
}
/* Else wait for both fingers to have moved */ /* Else wait for both fingers to have moved */
dir1 = tp_gesture_get_direction(tp, first); dir1 = tp_gesture_get_direction(tp, first);