diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2017-12-19 14:54:53 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2018-04-20 09:04:13 +1000 |
commit | cfa921250d143c130103d460a6c487575bd54239 (patch) | |
tree | f6ffe9765b57123fe2d38ccbf087535311abba98 /src/evdev-mt-touchpad-buttons.c | |
parent | 2d845789a9da48c16b8827e64593b042754f1d05 (diff) | |
download | libinput-cfa921250d143c130103d460a6c487575bd54239.tar.gz |
touchpad: ignore palm touches when handling clickfingers
https://bugs.freedesktop.org/show_bug.cgi?id=104188
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src/evdev-mt-touchpad-buttons.c')
-rw-r--r-- | src/evdev-mt-touchpad-buttons.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/evdev-mt-touchpad-buttons.c b/src/evdev-mt-touchpad-buttons.c index 819fecc5..1b70a989 100644 --- a/src/evdev-mt-touchpad-buttons.c +++ b/src/evdev-mt-touchpad-buttons.c @@ -999,16 +999,11 @@ static uint32_t tp_clickfinger_set_button(struct tp_dispatch *tp) { uint32_t button; - unsigned int nfingers = tp->nfingers_down; + unsigned int nfingers = 0; struct tp_touch *t; struct tp_touch *first = NULL, *second = NULL; - if (nfingers != 2) - goto out; - - /* two fingers down on the touchpad. Check for distance - * between the fingers. */ tp_for_each_touch(tp, t) { if (t->state != TOUCH_BEGIN && t->state != TOUCH_UPDATE) continue; @@ -1016,16 +1011,21 @@ tp_clickfinger_set_button(struct tp_dispatch *tp) if (t->thumb.state == THUMB_STATE_YES) continue; + if (t->palm.state != PALM_NONE) + continue; + + nfingers++; + if (!first) first = t; else if (!second) second = t; } - if (!first || !second) { - nfingers = 1; + /* Only check for finger distance when there are 2 fingers on the + * touchpad */ + if (nfingers != 2) goto out; - } if (tp_clickfinger_within_distance(tp, first, second)) nfingers = 2; |