Revert "dix: don't XWarpPointer through the last slave anymore (#38313)"

This reverts commit 2bfb802839.

This commit caused a regression.

See: http://xquartz.macosforge.org/trac/ticket/517#comment:10

Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Jeremy Huddleston 2012-01-31 11:06:21 -08:00
parent cb6a32da27
commit 38000e7d1f

View File

@ -3449,21 +3449,16 @@ XineramaWarpPointer(ClientPtr client)
{ {
WindowPtr dest = NULL; WindowPtr dest = NULL;
int x, y, rc; int x, y, rc;
DeviceIntPtr dev; SpritePtr pSprite = PickPointer(client)->spriteInfo->sprite;
SpritePtr pSprite;
REQUEST(xWarpPointerReq); REQUEST(xWarpPointerReq);
if (stuff->dstWid != None) { if (stuff->dstWid != None) {
rc = dixLookupWindow(&dest, stuff->dstWid, client, DixReadAccess); rc = dixLookupWindow(&dest, stuff->dstWid, client, DixReadAccess);
if (rc != Success) if (rc != Success)
return rc; return rc;
} }
/* Post through the XTest device */
dev = PickPointer(client);
dev = GetXTestDevice(dev);
pSprite = dev->spriteInfo->sprite;
x = pSprite->hotPhys.x; x = pSprite->hotPhys.x;
y = pSprite->hotPhys.y; y = pSprite->hotPhys.y;
@ -3513,9 +3508,9 @@ XineramaWarpPointer(ClientPtr client)
else if (y >= pSprite->physLimits.y2) else if (y >= pSprite->physLimits.y2)
y = pSprite->physLimits.y2 - 1; y = pSprite->physLimits.y2 - 1;
if (pSprite->hotShape) if (pSprite->hotShape)
ConfineToShape(dev, pSprite->hotShape, &x, &y); ConfineToShape(PickPointer(client), pSprite->hotShape, &x, &y);
XineramaSetCursorPosition(dev, x, y, TRUE); XineramaSetCursorPosition(PickPointer(client), x, y, TRUE);
return Success; return Success;
} }
@ -3533,7 +3528,7 @@ ProcWarpPointer(ClientPtr client)
WindowPtr dest = NULL; WindowPtr dest = NULL;
int x, y, rc; int x, y, rc;
ScreenPtr newScreen; ScreenPtr newScreen;
DeviceIntPtr dev, tmp, xtest_dev = NULL; DeviceIntPtr dev, tmp;
SpritePtr pSprite; SpritePtr pSprite;
REQUEST(xWarpPointerReq); REQUEST(xWarpPointerReq);
@ -3546,13 +3541,11 @@ ProcWarpPointer(ClientPtr client)
rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixWriteAccess); rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixWriteAccess);
if (rc != Success) if (rc != Success)
return rc; return rc;
if (IsXTestDevice(tmp, dev))
xtest_dev = tmp;
} }
} }
/* Use the XTest device to actually move the pointer */ if (dev->lastSlave)
dev = xtest_dev; dev = dev->lastSlave;
pSprite = dev->spriteInfo->sprite; pSprite = dev->spriteInfo->sprite;
#ifdef PANORAMIX #ifdef PANORAMIX