summaryrefslogtreecommitdiff
path: root/Xext/xtest.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter@cs.unisa.edu.au>2007-02-28 15:43:06 +1030
committerPeter Hutterer <whot@hyena.localdomain>2007-02-28 15:43:06 +1030
commit2a35d44b6d87f96a7ce90dc8f0142f48cc176e95 (patch)
tree1c26e2dfd833a5fc6dc2dd9366b205443df3cdfd /Xext/xtest.c
parentbc4ae25433e38a25a2012f9f233d500665172a4b (diff)
Update device valuators on XTest motion event, otherwise the cursor jumps
between coordinates stored in device and coordinates sent by the event.
Diffstat (limited to 'Xext/xtest.c')
-rw-r--r--Xext/xtest.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/Xext/xtest.c b/Xext/xtest.c
index c59adeaee..d46d6e7d9 100644
--- a/Xext/xtest.c
+++ b/Xext/xtest.c
@@ -316,7 +316,7 @@ ProcXTestFakeInput(client)
#ifdef XINPUT
if (!extension)
#endif /* XINPUT */
- dev = (DeviceIntPtr)LookupKeyboardDevice();
+ dev = inputInfo.keyboard;
if (ev->u.u.detail < dev->key->curKeySyms.minKeyCode ||
ev->u.u.detail > dev->key->curKeySyms.maxKeyCode)
{
@@ -360,7 +360,8 @@ ProcXTestFakeInput(client)
break;
}
#endif /* XINPUT */
- dev = (DeviceIntPtr)LookupPointerDevice();
+ if (!dev)
+ dev = inputInfo.pointer;
if (ev->u.keyButtonPointer.root == None)
root = GetCurrentRootWindow();
else
@@ -378,7 +379,7 @@ ProcXTestFakeInput(client)
if (ev->u.u.detail == xTrue)
{
int x, y;
- GetSpritePosition(inputInfo.pointer, &x, &y);
+ GetSpritePosition(dev, &x, &y);
ev->u.keyButtonPointer.rootX += x;
ev->u.keyButtonPointer.rootY += y;
}
@@ -442,13 +443,15 @@ ProcXTestFakeInput(client)
(dev, root->drawable.pScreen,
ev->u.keyButtonPointer.rootX,
ev->u.keyButtonPointer.rootY, FALSE);
+ dev->valuator->lastx = ev->u.keyButtonPointer.rootX;
+ dev->valuator->lasty = ev->u.keyButtonPointer.rootY;
break;
case ButtonPress:
case ButtonRelease:
#ifdef XINPUT
if (!extension)
#endif /* XINPUT */
- dev = (DeviceIntPtr)LookupPointerDevice();
+ dev = inputInfo.pointer;
if (!ev->u.u.detail || ev->u.u.detail > dev->button->numButtons)
{
client->errorValue = ev->u.u.detail;