aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin/winkeybd.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xwin/winkeybd.c')
-rw-r--r--xorg-server/hw/xwin/winkeybd.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/xorg-server/hw/xwin/winkeybd.c b/xorg-server/hw/xwin/winkeybd.c
index 1cd3e4cb3..5ac558d98 100644
--- a/xorg-server/hw/xwin/winkeybd.c
+++ b/xorg-server/hw/xwin/winkeybd.c
@@ -308,12 +308,24 @@ winKeybdProc (DeviceIntPtr pDeviceInt, int iState)
#endif
break;
- case DEVICE_ON:
+ case DEVICE_ON:
+ {
+ DeviceIntPtr master;
pDevice->on = TRUE;
// immediately copy the state of this keyboard device to the VCK
// (which otherwise happens lazily after the first keypress)
- SwitchCoreKeyboard(pDeviceInt);
+ master = (!pDeviceInt->isMaster && pDeviceInt->u.master) ? pDeviceInt->u.master : NULL;
+ if (master)
+ {
+ /* Force a copy of the key class into the VCK so that the layout
+ is transferred. */
+ if (!master->key)
+ master = GetPairedDevice(master);
+ CopyKeyClass(pDeviceInt, master);
+ }
+ }
+
break;
case DEVICE_CLOSE: