summaryrefslogtreecommitdiff
path: root/Xext/xtest.c
diff options
context:
space:
mode:
authorBenjamin Close <Benjamin.Close@clearchain.com>2009-03-27 16:44:15 +1030
committerPeter Hutterer <peter.hutterer@who-t.net>2009-04-24 15:28:33 +1000
commitfab563bf8f6b63906ce9d5a568c467425843265b (patch)
tree99be39dc9fd9589b8bb2e183deaf49c29cfc315e /Xext/xtest.c
parentccd28ca2ad40aecf951ab058d89062828e3e5d8a (diff)
input: propagate XTst events through virtual slave devices.
A XTest virtual slave device pair (kbd/ptr) exists for every master device pair. This is so XTest events are correctly propogated via slave devices up to Master devices and the classes are correctly changed along the way. We add the XTest slave device pair to the Virtual Core pointer and provide a simple way of creating the devices. A XTest Slave Device is identified by the XTstDevicePrivateKey property being set in the devices devProperties XI events are still propagated through the matching device, in the hope the client knows what it is doing. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'Xext/xtest.c')
-rw-r--r--Xext/xtest.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/Xext/xtest.c b/Xext/xtest.c
index ab882311a..d21eedcde 100644
--- a/Xext/xtest.c
+++ b/Xext/xtest.c
@@ -54,6 +54,7 @@
extern int DeviceValuator;
extern int DeviceMotionNotify;
+extern DevPrivateKey XTstDevicePrivateKey;
#ifdef PANORAMIX
#include "panoramiX.h"
@@ -160,6 +161,7 @@ ProcXTestFakeInput(ClientPtr client)
int i;
int base = 0;
int flags = 0;
+ DeviceIntPtr xtstdevice;
nev = (stuff->length << 2) - sizeof(xReq);
if ((nev % sizeof(xEvent)) || !nev)
@@ -268,6 +270,8 @@ ProcXTestFakeInput(ClientPtr client)
} else
{
+ DeviceIntPtr it;
+
if (nev != 1)
return BadLength;
switch (type)
@@ -294,8 +298,14 @@ ProcXTestFakeInput(ClientPtr client)
return BadValue;
}
- if (dev->u.lastSlave)
- dev = dev->u.lastSlave;
+ /* When faking core events through XTest, we always fake through the
+ * virtual test device.
+ */
+ for(it = inputInfo.devices; it ; it = it->next )
+ if( !it->isMaster && it->u.master == dev &&
+ dixLookupPrivate(&it->devPrivates, XTstDevicePrivateKey ))
+ break;
+ dev= it;
}
/* If the event has a time set, wait for it to pass */
@@ -403,6 +413,7 @@ ProcXTestFakeInput(ClientPtr client)
for (i = 0; i < nevents; i++)
mieqProcessDeviceEvent(dev, (events+i)->event, NULL);
+ miPointerUpdateSprite(dev);
return client->noClientException;
}