aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/Xext/xtest.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/Xext/xtest.c')
-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 e7f94d3d9..b0b974c78 100644
--- a/xorg-server/Xext/xtest.c
+++ b/xorg-server/Xext/xtest.c
@@ -153,7 +153,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;
@@ -238,14 +237,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;
@@ -303,7 +302,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;
@@ -374,6 +373,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;
@@ -416,7 +423,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);