diff options
author | Hans de Goede <hdegoede@redhat.com> | 2014-04-11 20:41:36 +0200 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2014-04-30 12:53:00 +1000 |
commit | 8577f7dcf1c66c519c8d8d068e5d7ca84cacea9c (patch) | |
tree | 89e31347c65ac666d57491b1e5c6febc48b00b65 | |
parent | c5e59d9d910e611687957736cdc58593c1f56439 (diff) |
Always count tripletap + click as 3 fingerclick on pads with < 3 touches
When trying to do a 3 fingerclick on a touchpad which only tracks 2 touches,
this may register as a 3 or 2 fingerclick depending on the order in which
the touchpad detects the fingers. If the 2 outer fingers of the 3 get seen
first, then the 2 touches will be too far apart for the heuristic to see
them as being close together, and the click gets counted as a 2 finger click.
A user will likely never do a 2 finger click with a 3th finger resting
somewhere else on the pad, where-as the above misdetection of the clicks is
a real issue, so simply always count a click with trippletap set as a
3 finger click on pads which track less then 3 touches.
https://bugzilla.redhat.com/show_bug.cgi?id=1086218
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit a6f0f4c9a5bcb0e25343dd4c59d4cc47cc5e8006)
-rw-r--r-- | src/synaptics.c | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/src/synaptics.c b/src/synaptics.c index 0539066..3b1ea91 100644 --- a/src/synaptics.c +++ b/src/synaptics.c @@ -2585,26 +2585,11 @@ clickpad_guess_clickfingers(SynapticsPrivate * priv, } /* Some trackpads touchpad only track two touchpoints but announce - BTN_TOOL_TRIPLETAP (which sets hw->numFingers to 3). - This can affect clickfingers, in the following ways: - * one finger down: normal click - * two fingers down, close together: 2 finger click - * two fingers down, apart: normal click - * three fingers down, close together: 3 finger click - * three fingers down, with two grouped next to each other: should be - * 2-finger click but we can't detect this. - * so: if two detected fingers are close together and HW says three - * fingers, make it three fingers. - * if two detected fingers are apart and HW says three fingers, make - * it a two-finger click, guessing that the third finger is somewhere - * close to another finger. - */ - if (hw->numFingers >= 3 && nfingers < hw->numFingers) { - if (!nfingers) /* touchpoints too far apart */ - nfingers = 2; - else - nfingers++; - } + * BTN_TOOL_TRIPLETAP (which sets hw->numFingers to 3), when this happens + * the user likely intents to do a 3 finger click, so handle it as such. + */ + if (hw->numFingers >= 3 && hw->num_mt_mask < 3) + nfingers = 3; return nfingers; } |