aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/Xext
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/Xext')
-rw-r--r--xorg-server/Xext/xtest.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/xorg-server/Xext/xtest.c b/xorg-server/Xext/xtest.c
index 2abdc7f58..0a854f39a 100644
--- a/xorg-server/Xext/xtest.c
+++ b/xorg-server/Xext/xtest.c
@@ -156,7 +156,6 @@ ProcXTestFakeInput(ClientPtr client)
DeviceIntPtr dev = NULL;
WindowPtr root;
Bool extension = FALSE;
- deviceValuator *dv = NULL;
ValuatorMask mask;
int valuators[MAX_VALUATORS] = { 0 };
int numValuators = 0;
@@ -241,14 +240,14 @@ ProcXTestFakeInput(ClientPtr client)
}
if (nev > 1 && !dev->valuator) {
- client->errorValue = dv->first_valuator;
+ client->errorValue = firstValuator;
return BadValue;
}
/* check validity of valuator events */
base = firstValuator;
for (n = 1; n < nev; n++) {
- dv = (deviceValuator *) (ev + n);
+ deviceValuator *dv = (deviceValuator *) (ev + n);
if (dv->type != DeviceValuator) {
client->errorValue = dv->type;
return BadValue;
@@ -306,7 +305,7 @@ ProcXTestFakeInput(ClientPtr client)
numValuators = 2;
firstValuator = 0;
if (ev->u.u.detail == xFalse)
- flags = POINTER_ABSOLUTE | POINTER_SCREEN;
+ flags = POINTER_ABSOLUTE | POINTER_DESKTOP;
break;
default:
client->errorValue = ev->u.u.type;
@@ -377,6 +376,14 @@ ProcXTestFakeInput(ClientPtr client)
client->errorValue = ev->u.keyButtonPointer.root;
return BadValue;
}
+
+ /* Add the root window's offset to the valuators */
+ if ((flags & POINTER_ABSOLUTE) && firstValuator <= 1 && numValuators > 0) {
+ if (firstValuator == 0)
+ valuators[0] += root->drawable.pScreen->x;
+ if (firstValuator < 2 && firstValuator + numValuators > 1)
+ valuators[1 - firstValuator] += root->drawable.pScreen->y;
+ }
}
if (ev->u.u.detail != xTrue && ev->u.u.detail != xFalse) {
client->errorValue = ev->u.u.detail;
@@ -419,7 +426,7 @@ ProcXTestFakeInput(ClientPtr client)
}
for (i = 0; i < nevents; i++)
- mieqProcessDeviceEvent(dev, &xtest_evlist[i], NULL);
+ mieqProcessDeviceEvent(dev, &xtest_evlist[i], miPointerGetScreen(inputInfo.pointer));
if (need_ptr_update)
miPointerUpdateSprite(dev);