From a6ca4d2523904b7ce49edc29ba408979bdf0d45e Mon Sep 17 00:00:00 2001 From: Chris Bagwell Date: Wed, 18 Aug 2010 22:09:45 -0500 Subject: Reset X/Y hist on multi finger transition to fix jumps Most modern touchpads track 1st finger during multi-touch. If first finger is lifted then a jump will occur as X/Y transition to next finger location. Resetting X/Y history as each finger is lifted will hide this transition. Synaptics hw specs claim older hardware report X/Y values that are average point between multi-fingers which can cause unwanted jump. Reset X/Y history during transition to new fingers to hide this as well. Signed-off-by: Chris Bagwell Tested-by: Peter Hutterer Signed-off-by: Peter Hutterer --- src/synaptics.c | 3 ++- src/synapticsstr.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/synaptics.c b/src/synaptics.c index 9d0bf14..1184f30 100644 --- a/src/synaptics.c +++ b/src/synaptics.c @@ -1724,7 +1724,7 @@ ComputeDeltas(SynapticsPrivate *priv, const struct SynapticsHwState *hw, if (inside_area && moving_state && !priv->palm && !priv->vert_scroll_edge_on && !priv->horiz_scroll_edge_on && !priv->vert_scroll_twofinger_on && !priv->horiz_scroll_twofinger_on && - !priv->circ_scroll_on) { + !priv->circ_scroll_on && priv->prevFingers == hw->numFingers) { /* FIXME: Wtf?? what's with 13? */ delay = MIN(delay, 13); if (priv->count_packet_finger > 3) { /* min. 3 packets */ @@ -1794,6 +1794,7 @@ ComputeDeltas(SynapticsPrivate *priv, const struct SynapticsHwState *hw, } else { /* reset packet counter */ priv->count_packet_finger = 0; } + priv->prevFingers = hw->numFingers; *dxP = dx; *dyP = dy; diff --git a/src/synapticsstr.h b/src/synapticsstr.h index b4a72aa..caa0476 100644 --- a/src/synapticsstr.h +++ b/src/synapticsstr.h @@ -218,6 +218,7 @@ typedef struct _SynapticsPrivateRec int palm; /* Set to true when palm detected, reset to false when palm/finger contact disappears */ int prev_z; /* previous z value, for palm detection */ + int prevFingers; /* previous numFingers, for transition detection */ int avg_width; /* weighted average of previous fingerWidth values */ double horiz_coeff; /* normalization factor for x coordintes */ double vert_coeff; /* normalization factor for y coordintes */ -- cgit v1.2.3