summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter@cs.unisa.edu.au>2008-04-18 21:13:10 +0930
committerPeter Hutterer <peter@cs.unisa.edu.au>2008-04-22 17:45:55 +0930
commit179a082c26f9e562492ee2e59e7f44f949f39f9c (patch)
treef6bab47f30766f073b43708580e0865a4620e723
parentfb784d99c521823339bf00b70b9824f735d88875 (diff)
Xext: route event through master if required (XTestFakeInput)
-rw-r--r--Xext/xtest.c10
-rw-r--r--mi/mieq.c2
2 files changed, 10 insertions, 2 deletions
diff --git a/Xext/xtest.c b/Xext/xtest.c
index 721dacc0c..e11f35876 100644
--- a/Xext/xtest.c
+++ b/Xext/xtest.c
@@ -471,7 +471,15 @@ ProcXTestFakeInput(client)
if (screenIsSaved == SCREEN_SAVER_ON)
dixSaveScreens(serverClient, SCREEN_SAVER_OFF, ScreenSaverReset);
ev->u.keyButtonPointer.time = currentTime.milliseconds;
- (*dev->public.processInputProc)(ev, dev, nev);
+ if (!dev->isMaster && dev->u.master)
+ { /* duplicate and route through master */
+ xEvent *master_event = NULL;
+ CopyGetMasterEvent(dev->u.master, ev, &master_event, nev);
+ (*dev->public.processInputProc)(ev, dev, nev);
+ (*dev->public.processInputProc)(master_event, dev->u.master, nev);
+ xfree(master_event);
+ } else
+ (*dev->public.processInputProc)(ev, dev, nev);
return client->noClientException;
}
diff --git a/mi/mieq.c b/mi/mieq.c
index cae55162f..1c85030a3 100644
--- a/mi/mieq.c
+++ b/mi/mieq.c
@@ -263,7 +263,7 @@ ChangeDeviceID(DeviceIntPtr dev, xEvent* event)
* @param master The event after being copied
* @param count Number of events in original.
*/
-static void
+void
CopyGetMasterEvent(DeviceIntPtr mdev, xEvent* original,
xEvent** master, int count)
{