From 10c0287232eab1b93d078774f52e65efa0c03607 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 12 Jan 2009 11:07:08 +1000 Subject: [PATCH 1/2] dix: Fix handling of do_not_propagate_mask window attribute. This was broken in 32aa252e988be8cbfd4f7e373fb7b7736ef1f5f2. Signed-off-by: Kim Woelders Signed-off-by: Peter Hutterer (cherry picked from commit 30d2cfcd3851870178d62e5067211aa36f87fbd2) Conflicts: dix/events.c --- dix/events.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/dix/events.c b/dix/events.c index 5530c012f..122ce6abc 100644 --- a/dix/events.c +++ b/dix/events.c @@ -2351,13 +2351,11 @@ DeliverDeviceEvents(WindowPtr pWin, xEvent *xE, GrabPtr grab, if (deliveries > 0) return deliveries; } - - if ((deliveries < 0) || - (pWin == stopAt) || - (inputMasks && - (filter & inputMasks->dontPropagateMask[mskidx]))) - return 0; } + + if ((deliveries < 0) || (pWin == stopAt) || + (inputMasks && (filter & inputMasks->dontPropagateMask[mskidx]))) + return 0; } else { core = *xE; @@ -2373,12 +2371,11 @@ DeliverDeviceEvents(WindowPtr pWin, xEvent *xE, GrabPtr grab, if (deliveries > 0) return deliveries; } - - if ((deliveries < 0) || - (pWin == stopAt) || - (filter & wDontPropagateMask(pWin))) - return 0; } + + if ((deliveries < 0) || (pWin == stopAt) || + (filter & wDontPropagateMask(pWin))) + return 0; } child = pWin->drawable.id; From 82f42730fa268e85dc95c43a6450c35f9e57acdf Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 15 Dec 2008 10:46:07 +1000 Subject: [PATCH 2/2] mi: force CopyKeyClass for key events. (#19048) While we don't want to copy all other device classes into the VCK, we need to copy the key class to transfer the layout from the SDs into the VCK. This resembles the functionality of SwitchCoreKeyboard in server 1.5. Thanks to Colin Guthrie for providing the follow-up patch (#19222) X.Org Bug 19048 Signed-off-by: Peter Hutterer --- Xi/exevents.c | 2 +- mi/mieq.c | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Xi/exevents.c b/Xi/exevents.c index 6141f5edd..083bb2f0e 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -186,7 +186,7 @@ XIGetDevice(xEvent* xE) * This code is basically the old SwitchCoreKeyboard. */ -static void +void CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master) { static DeviceIntPtr lastMapNotifyDevice = NULL; diff --git a/mi/mieq.c b/mi/mieq.c index db48f55e5..b7392a186 100644 --- a/mi/mieq.c +++ b/mi/mieq.c @@ -298,6 +298,8 @@ CopyGetMasterEvent(DeviceIntPtr mdev, xEvent* original, while (count--) ChangeDeviceID(mdev, &master->event[count]); } +extern void +CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master); /* Call this from ProcessInputEvents(). */ void @@ -360,8 +362,15 @@ mieqProcessInputEvents(void) NewCurrentScreen (dev, DequeueScreen(dev), x, y); } else { - if (master) + if (master) { + /* Force a copy of the key class into the VCK so that the layout + is transferred. */ + if (event->u.u.type == DeviceKeyPress || + event->u.u.type == DeviceKeyRelease) + CopyKeyClass(dev, master); + CopyGetMasterEvent(master, event, masterEvents, nevents); + } /* If someone's registered a custom event handler, let them * steal it. */