summaryrefslogtreecommitdiff
path: root/Xext
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2013-01-26 15:53:08 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2013-02-08 13:49:49 +1000
commit8571c648a79444bcee9a0fe6e395129116372f49 (patch)
tree143843a256d3ccda8f461749de9a089dcebaf5ee /Xext
parent9fd6cb89539fde44a41ae5183c89ef9c8831c8dd (diff)
Xext: if a root window is given in XTestFakeInput, move to that
For absolute events, if the client specifies a screen number offset the coordinates by that. And add a new flag so we know when _not_ to add the screen offset in GPE. Without this offset and the flag, GPE would simply add the offset of the current screen if POINTER_SCREEN is set. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'Xext')
-rw-r--r--Xext/xtest.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/Xext/xtest.c b/Xext/xtest.c
index 209bbdd72..0a854f39a 100644
--- a/Xext/xtest.c
+++ b/Xext/xtest.c
@@ -305,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;
@@ -376,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;