[PATCH synaptics 07/12] Use post_button_click to post doubleclicks.

Peter Hutterer peter.hutterer at who-t.net
Sun May 9 20:34:47 PDT 2010


On Fri, May 07, 2010 at 04:40:21PM -0700, Jamey Sharp wrote:
> The first hunk is obviously an improvement but the other two aren't clear to me.
> 
> On Thu, May 6, 2010 at 9:41 PM, Peter Hutterer <peter.hutterer at who-t.net> wrote:
> > @@ -2288,11 +2286,8 @@ HandleState(LocalDevicePtr local, struct SynapticsHwState *hw)
> >        post_scroll_events(local, scroll);
> >
> >     if (double_click) {
> > -       int i;
> > -       for (i = 0; i < 2; i++) {
> > -           xf86PostButtonEvent(local->dev, FALSE, 1, !hw->left, 0, 0);
> > -           xf86PostButtonEvent(local->dev, FALSE, 1, hw->left, 0, 0);
> > -       }
> > +       post_button_click(local, 1);
> > +       post_button_click(local, 1);
> >     }
> 
> An earlier commit converted the !hw->foo, hw->foo pattern to TRUE,
> FALSE; perhaps that commit should make the same change here before
> this one replaces the pair with post_button_click?

yep, will squash in, thanks.

> > @@ -2320,8 +2315,7 @@ HandleState(LocalDevicePtr local, struct SynapticsHwState *hw)
> >            while (change) {
> >                id = ffs(change);
> >                change &= ~(1 << (id - 1));
> > -               xf86PostButtonEvent(local->dev, FALSE, id, FALSE, 0, 0);
> > -               xf86PostButtonEvent(local->dev, FALSE, id, TRUE, 0, 0);
> > +               post_button_click(local, id);
> >            }
> 
> Here the button events are exactly backwards. Was that intentional,
> and is it OK to swap them, as this patch does?

Actually, reading this again this hunk was erroneous. this block is in the
button repeat section, hence what it does is release an already pressed
button and re-presses it to get the repeat effect. So this one should stay
as-is, possibly cleaned up at later point in time.

Cheers,
  Peter


More information about the xorg-devel mailing list