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. */