summaryrefslogtreecommitdiff
path: root/dix
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2014-02-26 16:20:08 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2014-03-11 17:43:34 +1000
commit45fb3a934dc0db51584aba37c2f9d73deff9191d (patch)
tree4f79790f2247c7ec67dedb864322e40c497416c6 /dix
parent656841798c99bcd79da47c03ec666a48b855541f (diff)
xkb: push locked modifier state down to attached slave devices
Whenever the master changes, push the locked modifier state to the attached slave devices, then update the indicators. This way, when NumLock or CapsLock are hit on any device, the LED will light up on all devices. Likewise, a new keyboard attached to a master device will light up with the correct indicators. The indicators are handled per-keyboard, depending on the layout, i.e. if one keyboard has grp_led:num set, the NumLock LED won't light up on that keyboard. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Diffstat (limited to 'dix')
-rw-r--r--dix/devices.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/dix/devices.c b/dix/devices.c
index 1c86d5242..ab923d574 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -416,6 +416,8 @@ EnableDevice(DeviceIntPtr dev, BOOL sendevent)
XISendDeviceHierarchyEvent(flags);
}
+ if (!IsMaster(dev))
+ XkbPushLockedStateToSlaves(GetMaster(dev, MASTER_KEYBOARD), 0, 0);
RecalculateMasterButtons(dev);
/* initialise an idle timer for this device*/
@@ -2649,6 +2651,7 @@ AttachDevice(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr master)
dev->spriteInfo->paired = master;
dev->spriteInfo->spriteOwner = FALSE;
+ XkbPushLockedStateToSlaves(GetMaster(dev, MASTER_KEYBOARD), 0, 0);
RecalculateMasterButtons(master);
}