summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Bagwell <chris@cnpbagwell.com>2010-08-18 22:09:45 -0500
committerPeter Hutterer <peter.hutterer@who-t.net>2010-08-20 10:49:57 +1000
commita6ca4d2523904b7ce49edc29ba408979bdf0d45e (patch)
tree6c2b968234cd45bdd928b37f814543e1036d0ad7
parentb774a1dba2f1f45c94fe898fe8b5ce258cbcddfc (diff)
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 <chris@cnpbagwell.com> Tested-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/synaptics.c3
-rw-r--r--src/synapticsstr.h1
2 files changed, 3 insertions, 1 deletions
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 */