From 8af2793a90e8e644a6a598adce3f752c15b3e37a Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 3 Sep 2009 11:30:48 +1000 Subject: [PATCH] xkb: xkbGetKbdByName on the lastSlave needs to change the master (#21859) If the layout is changed on a master's lastSlave, the master needs to change layout immediately. Otherwise, the master stays on the same layout until the lastSlave changes - which may not happen if only a single keyboard is available. X.Org Bug 21859 Signed-off-by: Peter Hutterer --- xkb/xkb.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/xkb/xkb.c b/xkb/xkb.c index b0d92b798..0b54a2ec9 100644 --- a/xkb/xkb.c +++ b/xkb/xkb.c @@ -5867,6 +5867,16 @@ ProcXkbGetKbdByName(ClientPtr client) if (geom_changed) nkn.changed|= XkbNKN_GeometryMask; XkbSendNewKeyboardNotify(dev,&nkn); + + if (!IsMaster(dev) && dev->u.master) + { + DeviceIntPtr master = dev->u.master; + if (master->u.lastSlave == dev) + { + XkbCopyDeviceKeymap(dev->u.master, dev); + XkbSendNewKeyboardNotify(dev,&nkn); + } + } } if ((new!=NULL)&&(new!=xkb)) { XkbFreeKeyboard(new,XkbAllComponentsMask,True);