[PATCH] xkb: xkbGetKbdByName on the lastSlave needs to change the master (#21859)

Peter Hutterer peter.hutterer at who-t.net
Wed Sep 2 18:46:25 PDT 2009


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 <http://bugs.freedesktop.org/show_bug.cgi?id=21859>

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 xkb/xkb.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/xkb/xkb.c b/xkb/xkb.c
index b0d92b7..0b54a2e 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);
-- 
1.6.3.rc1.2.g0164.dirty


More information about the xorg-devel mailing list