dix: don't XWarpPointer through the last slave anymore (#38313)
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@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
(cherry picked from commit 2bfb802839)
This commit is contained in:
21
dix/events.c
21
dix/events.c
@@ -3351,16 +3351,21 @@ XineramaWarpPointer(ClientPtr client)
|
|||||||
{
|
{
|
||||||
WindowPtr dest = NULL;
|
WindowPtr dest = NULL;
|
||||||
int x, y, rc;
|
int x, y, rc;
|
||||||
SpritePtr pSprite = PickPointer(client)->spriteInfo->sprite;
|
DeviceIntPtr dev;
|
||||||
|
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;
|
||||||
|
|
||||||
@@ -3410,9 +3415,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(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;
|
return Success;
|
||||||
}
|
}
|
||||||
@@ -3430,7 +3435,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;
|
DeviceIntPtr dev, tmp, xtest_dev = NULL;
|
||||||
SpritePtr pSprite;
|
SpritePtr pSprite;
|
||||||
|
|
||||||
REQUEST(xWarpPointerReq);
|
REQUEST(xWarpPointerReq);
|
||||||
@@ -3443,11 +3448,13 @@ 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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dev->lastSlave)
|
/* Use the XTest device to actually move the pointer */
|
||||||
dev = dev->lastSlave;
|
dev = xtest_dev;
|
||||||
pSprite = dev->spriteInfo->sprite;
|
pSprite = dev->spriteInfo->sprite;
|
||||||
|
|
||||||
#ifdef PANORAMIX
|
#ifdef PANORAMIX
|
||||||
|
|||||||
Reference in New Issue
Block a user