From 179a082c26f9e562492ee2e59e7f44f949f39f9c Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 18 Apr 2008 21:13:10 +0930 Subject: Xext: route event through master if required (XTestFakeInput) --- Xext/xtest.c | 10 +++++++++- mi/mieq.c | 2 +- 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) { -- cgit v1.2.3