[PATCH synaptics v2 09/21] Add last_scroll_millis to track scroll event timing

Daniel Stone daniel at fooishbar.org
Thu Jun 23 03:15:00 PDT 2011


Hi,

On Wed, Jun 15, 2011 at 02:55:13PM +0800, Daniel Kurtz wrote:
> On Wed, Jun 15, 2011 at 1:05 AM, Daniel Stone <daniel at fooishbar.org> wrote:
> > @@ -1754,7 +1754,7 @@ get_delta_for_trackstick(SynapticsPrivate *priv, const struct SynapticsHwState *
> >                          double *dx, double *dy)
> >  {
> >     SynapticsParameters *para = &priv->synpara;
> > -    double dtime = (hw->millis - HIST(0).millis) / 1000.0;
> > +    double dtime = (hw->millis - priv->last_scroll_millis) / 1000.0;
> 
> Will this cause giant random jump at the beginning of the first
> scroll, since last_scroll_millis is uninitialized, or at every
> subsequent 'new' scroll, since last_scroll_millis still holds the time
> of some ancient scroll?

Only for touch drags which touched the edge.

> Maybe I'm missing something?

Well, this and the get_delta hunks were fairly incongruous anyway as
they weren't actually related to scrolling, so I've just removed them.
The rest of it only uses it from the coasting code, which will have a
good last_scroll_millis.

Cheers,
Daniel


More information about the xorg-devel mailing list