From b3348eb7e4e2187e11aa3c1cec2a58512759e6aa Mon Sep 17 00:00:00 2001 From: Chase Douglas Date: Wed, 21 Mar 2012 12:58:30 -0700 Subject: [PATCH] Include open but unchanged touches when guessing clickfingers On a clickpad, when the button is pressed the clickfinger guessing will only work properly if all touches have new data to report. If a touch has not changed, then it will not be counted. This leads to inaccurate finger counts. This change ensures that all active touches are counted. Note that the X and Y valuators of active but unchanged touches are still valid. Signed-off-by: Chase Douglas Signed-off-by: Peter Hutterer --- src/synaptics.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/synaptics.c b/src/synaptics.c index e22929b..3c5b12d 100644 --- a/src/synaptics.c +++ b/src/synaptics.c @@ -2600,8 +2600,8 @@ clickpad_guess_clickfingers(SynapticsPrivate *priv, struct SynapticsHwState *hw) for (i = 0; i < hw->num_mt_mask - 1; i++) { ValuatorMask *f1; - /* you can't click on open, you're not fast enough */ - if (hw->slot_state[i] != SLOTSTATE_UPDATE) + if (hw->slot_state[i] == SLOTSTATE_EMPTY || + hw->slot_state[i] == SLOTSTATE_CLOSE) continue; f1 = hw->mt_mask[i]; @@ -2610,7 +2610,8 @@ clickpad_guess_clickfingers(SynapticsPrivate *priv, struct SynapticsHwState *hw) ValuatorMask *f2; double x1, x2, y1, y2; - if (hw->slot_state[j] != SLOTSTATE_UPDATE) + if (hw->slot_state[j] == SLOTSTATE_EMPTY || + hw->slot_state[j] == SLOTSTATE_CLOSE) continue; f2 = hw->mt_mask[j];