[PATCH 08/18] Avoid unexpected jumps

Takashi Iwai tiwai at suse.de
Mon Oct 11 11:34:24 PDT 2010


At Mon, 11 Oct 2010 12:58:55 -0500,
Chris Bagwell wrote:
> 
> On Fri, Oct 8, 2010 at 12:22 PM, Takashi Iwai <tiwai at suse.de> wrote:
> > Limit the movement size for avoiding the unexpected pointer jumps.
> >
> 
> Hi Takashi,
> 
> This is type of patch I was concerned with.  Using only 1/5 distance
> of touchpad to discard invalid packets seems pretty low threshold.

True.  (Though, I never got such a large jump with normal operation,
maybe light-speed hand waving is needed :)

> If we can prevent change of ABS_X/ABS_Y only at touch transitions then
> we can make use of following commit to prevent unwanted jumps.
> 
> Basically, its "if (prevFinger != currentFinger) count_packet_finger = 0;".
> 
> http://cgit.freedesktop.org/xorg/driver/xf86-input-synaptics/commit/?id=a6ca4d2523904b7ce49edc29ba408979bdf0d45e

Right.  Similar codes are found in the multi-touch patch part.

This patch (move-threshold) was written just for non-MT cases.
Basically, all patches numbered before multi-touch patch were designed
for non-MT operations, thus some of them are obsolete with MT.


thanks,

Takashi

> 
> Chris
> 
> > Signed-off-by: Takashi Iwai <tiwai at suse.de>
> > ---
> >  src/synaptics.c    |   10 ++++++++++
> >  src/synapticsstr.h |    1 +
> >  2 files changed, 11 insertions(+), 0 deletions(-)
> >
> > diff --git a/src/synaptics.c b/src/synaptics.c
> > index 3ba918a..bd52730 100644
> > --- a/src/synaptics.c
> > +++ b/src/synaptics.c
> > @@ -467,6 +467,8 @@ static void set_default_parameters(InputInfoPtr pInfo)
> >     edgeMotionMaxSpeed = diag * .080;
> >     accelFactor = 200.0 / diag; /* trial-and-error */
> >
> > +    priv->move_ptr_threshold = width / 5;
> > +
> >     range = priv->maxp - priv->minp;
> >
> >     /* scaling based on defaults and a pressure of 256 */
> > @@ -1949,6 +1951,14 @@ ComputeDeltas(SynapticsPrivate *priv, const struct SynapticsHwState *hw,
> >            break;
> >        }
> >     }
> > +
> > +    if (moving_state && priv->count_packet_finger > 0 &&
> > +       priv->move_ptr_threshold > 0 ) {
> > +       int d = move_distance(HIST(0).x - hw->x, HIST(0).y - hw->y);
> > +       if (d > priv->move_ptr_threshold)
> > +           priv->count_packet_finger = 0; /* to avoid unexpected jumps */
> > +    }
> > +
> >     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 &&
> > diff --git a/src/synapticsstr.h b/src/synapticsstr.h
> > index 44140f2..44925e5 100644
> > --- a/src/synapticsstr.h
> > +++ b/src/synapticsstr.h
> > @@ -245,6 +245,7 @@ typedef struct _SynapticsPrivateRec
> >     unsigned int clickpad_threshold;
> >     int clickpad_dx, clickpad_dy;
> >     struct SynapticsHwState prev_hw;   /* previous h/w state (for clickpad) */
> > +    int move_ptr_threshold;
> >     int prop_change_pending;
> >     Bool led_touch_state;
> >     Bool led_tapped;
> > --
> > 1.7.3.1
> >
> > _______________________________________________
> > xorg-devel at lists.x.org: X.Org development
> > Archives: http://lists.x.org/archives/xorg-devel
> > Info: http://lists.x.org/mailman/listinfo/xorg-devel
> >
> 


More information about the xorg-devel mailing list