touchpad: drop thumb handling from gestures

Thumb detection interfered with gestures a fair bit but it shouldn't. A pinch
gesture with a thumb is a fairly natural move so we shouldn't cancel that.
A swipe gesture with a thumb on the touchpad - well, don't do that. No need
for code here.

Reported-by: Carlos Garnacho <carlosg@gnome.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Carlos Garnacho <carlosg@gnome.org>
This commit is contained in:
Peter Hutterer 2015-07-15 10:04:46 +10:00
parent abed81f29b
commit 9784b1d451
3 changed files with 1 additions and 21 deletions

View file

@ -546,34 +546,15 @@ tp_gesture_handle_state(struct tp_dispatch *tp, uint64_t time)
{
unsigned int active_touches = 0;
struct tp_touch *t;
uint32_t old_thumb_mask, thumb_mask = 0;
int i = 0;
tp_for_each_touch(tp, t) {
if (tp_touch_active(tp, t))
active_touches++;
if (t->is_thumb)
thumb_mask |= 1 << i;
i++;
}
old_thumb_mask = tp->gesture.thumb_mask;
tp->gesture.thumb_mask = thumb_mask;
/* active touches does not include thumb touches, need to count those
* separately, in a bitmask.
* then, if the finger count changes and/or the thumb count changes
* -> cancel gesture.
*/
if (thumb_mask != old_thumb_mask) {
/* if a thumb is detected during a gesture, that gesture is
* cancelled and the user effectively needs to restart. we
* could be smarter, but the complexity isn't worth it */
tp_gesture_cancel(tp, time);
return;
}
if (active_touches != tp->gesture.finger_count) {
/* If all fingers are lifted immediately end the gesture */
if (active_touches == 0) {

View file

@ -629,7 +629,7 @@ tp_thumb_detect(struct tp_dispatch *tp, struct tp_touch *t)
* - clickfinger must ignore this touch for finger count
* - software buttons are unaffected
* - edge scrolling unaffected
* - gestures: cancel
* - gestures: unaffected
* - tapping: honour thumb on begin, ignore it otherwise for now,
* this gets a tad complicated otherwise
*/

View file

@ -237,7 +237,6 @@ struct tp_dispatch {
double prev_scale;
double angle;
struct device_float_coords center;
uint32_t thumb_mask;
} gesture;
struct {