[PATCH] Reset X/Y hist on multi finger transition to fix jumps

Peter Hutterer peter.hutterer at who-t.net
Thu Aug 19 17:49:43 PDT 2010


On Wed, Aug 18, 2010 at 10:09:45PM -0500, chris at cnpbagwell.com wrote:
> From: Chris Bagwell <chris at cnpbagwell.com>
> 
> Most modern track 1st finger during multi-touch.  If
             ^ touchpads?

> 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 at cnpbagwell.com>
> ---

I like it, simple and it works well both on a multi-finger and a
single-finger touchpad (with your recent two-finger emulation patches)

merged, thank you.


Cheers,
  Peter

>  src/synaptics.c    |    3 ++-
>  src/synapticsstr.h |    1 +
>  2 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/src/synaptics.c b/src/synaptics.c
> index aa14f76..99b16cc 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 */
> -- 
> 1.7.2


More information about the xorg-devel mailing list