[PATCH v2] dix: don't XWarpPointer through the last slave anymore (#38313)

Peter Hutterer peter.hutterer at who-t.net
Thu Nov 3 14:53:42 PDT 2011


On Thu, Nov 03, 2011 at 02:04:11AM -0700, Jeremy Huddleston wrote:
> This introduces a regression:
> 
> http://xquartz.macosforge.org/trac/ticket/517#comment:10
> 
> I see similar behavior changes in wine on Linux as I do on XQuartz, so I don't think it's specific to XQuartz.
> 
> I'm planning on reverting this change from the 1.11 branch for tomorrow's
> release unless someone manages to convince me otherwise in the next ~12
> hours.

please do so, I won't have time to look at this for a few days.

Cheers,
  Peter

> --Jeremy
> 
> On Aug 10, 2011, at 10:19 PM, Peter Hutterer wrote:
> 
> > This line was introduced pre-1.6 to fix Bug 19297. The effect of warping
> > through the VCP then was that if a device had custom valuator ranges, the
> > warp position would be wrong. The better device for this effect is the the
> > XTest device.
> > 
> > This fixes a server crash where the lastSlave is a pointer device without
> > valuators (Bug 38313#0).
> > 
> > And while we're at it, make sure the Xinerama code-path does the same.
> > 
> > X.Org Bug 38313 <http://bugs.freedesktop.org/show_bug.cgi?id=38313>
> > 
> > Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> > ---
> > changes to v1:
> > - use the XTest device, not the VCP directly
> > - fix up xinerama to do the same
> > 
> > dix/events.c |   21 ++++++++++++++-------
> > 1 files changed, 14 insertions(+), 7 deletions(-)
> > 
> > diff --git a/dix/events.c b/dix/events.c
> > index d78989d..9596481 100644
> > --- a/dix/events.c
> > +++ b/dix/events.c
> > @@ -3377,16 +3377,21 @@ XineramaWarpPointer(ClientPtr client)
> > {
> >     WindowPtr	dest = NULL;
> >     int		x, y, rc;
> > -    SpritePtr   pSprite = PickPointer(client)->spriteInfo->sprite;
> > +    DeviceIntPtr dev;
> > +    SpritePtr   pSprite;
> > 
> >     REQUEST(xWarpPointerReq);
> > 
> > -
> >     if (stuff->dstWid != None) {
> > 	rc = dixLookupWindow(&dest, stuff->dstWid, client, DixReadAccess);
> > 	if (rc != Success)
> > 	    return rc;
> >     }
> > +
> > +    /* Post through the XTest device */
> > +    dev = PickPointer(client);
> > +    dev = GetXTestDevice(dev);
> > +    pSprite = dev->spriteInfo->sprite;
> >     x = pSprite->hotPhys.x;
> >     y = pSprite->hotPhys.y;
> > 
> > @@ -3436,9 +3441,9 @@ XineramaWarpPointer(ClientPtr client)
> >     else if (y >= pSprite->physLimits.y2)
> > 	y = pSprite->physLimits.y2 - 1;
> >     if (pSprite->hotShape)
> > -	ConfineToShape(PickPointer(client), pSprite->hotShape, &x, &y);
> > +	ConfineToShape(dev, pSprite->hotShape, &x, &y);
> > 
> > -    XineramaSetCursorPosition(PickPointer(client), x, y, TRUE);
> > +    XineramaSetCursorPosition(dev, x, y, TRUE);
> > 
> >     return Success;
> > }
> > @@ -3456,7 +3461,7 @@ ProcWarpPointer(ClientPtr client)
> >     WindowPtr	dest = NULL;
> >     int		x, y, rc;
> >     ScreenPtr	newScreen;
> > -    DeviceIntPtr dev, tmp;
> > +    DeviceIntPtr dev, tmp, xtest_dev = NULL;
> >     SpritePtr   pSprite;
> > 
> >     REQUEST(xWarpPointerReq);
> > @@ -3469,11 +3474,13 @@ ProcWarpPointer(ClientPtr client)
> > 	    rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixWriteAccess);
> > 	    if (rc != Success)
> > 		return rc;
> > +            if (IsXTestDevice(tmp, dev))
> > +                xtest_dev = tmp;
> > 	}
> >     }
> > 
> > -    if (dev->lastSlave)
> > -        dev = dev->lastSlave;
> > +    /* Use the XTest device to actually move the pointer */
> > +    dev = xtest_dev;
> >     pSprite = dev->spriteInfo->sprite;
> > 
> > #ifdef PANORAMIX
> > -- 
> > 1.7.6
> > 
> > _______________________________________________
> > 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