[PATCH 1/5] xkb: Post PointerKeys through the XTEST device.

Peter Hutterer peter.hutterer at who-t.net
Thu Apr 15 23:30:00 PDT 2010


On Thu, Apr 15, 2010 at 01:21:31PM +1000, Daniel Stone wrote:
> On Wed, Apr 14, 2010 at 11:08:10AM +1000, Peter Hutterer wrote:
> > Posting an event through a master device may cause pointer jumps once
> > lastSlave == master, caused by double scaling. To avoid this, post the fake
> > event generated by XKB through the XTEST device instead.
> > 
> > Fedora bug #560356 <https://bugzilla.redhat.com/560356>
> > Tested-by: Andrew McNabb
> > 
> > Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> > ---
> >  xkb/ddxDevBtn.c |    4 ++--
> >  1 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/xkb/ddxDevBtn.c b/xkb/ddxDevBtn.c
> > index 94630d1..3bee84b 100644
> > --- a/xkb/ddxDevBtn.c
> > +++ b/xkb/ddxDevBtn.c
> > @@ -51,13 +51,13 @@ XkbDDXFakeDeviceButton(DeviceIntPtr dev,Bool press,int button)
> >      /* If dev is a slave device, and the SD is attached, do nothing. If we'd
> >       * post through the attached master pointer we'd get duplicate events.
> >       *
> > -     * if dev is a master keyboard, post through the master pointer.
> > +     * if dev is a master keyboard, post through the XTEST device
> >       *
> >       * if dev is a floating slave, post through the device itself.
> >       */
> >  
> >      if (IsMaster(dev))
> > -        ptr = GetMaster(dev, MASTER_POINTER);
> > +        ptr = GetXTestDevice(GetMaster(dev, MASTER_POINTER));
> >      else if (!dev->u.master)
> >          ptr = dev;
> 
> Hm, is dev->valuator guaranteed to exist here? Maybe:
>     ptr = NULL;
>     if (!dev->u.master)
>         ptr = dev;
>     if (IsMaster(dev) || (ptr && !ptr->valuator))
>         ptr = GetMaster(dev, MASTER_POINTER);
> 

GPE has these checks in place, so they're not strictly necessary.

> Anyway, for the series:
> Reviewed-by: Daniel Stone <daniel at fooishbar.org>

thanks.

Cheers,
  Peter


More information about the xorg-devel mailing list