[PATCH 3/3] xkb: if the master changes modifiers, push that down to the slave

Peter Hutterer peter.hutterer at who-t.net
Sun Feb 23 21:33:51 PST 2014


If a slave device triggers e.g. NumLock, this needs to be pushed down to all
attached slave devices so that the LEDs light up on all of them.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 xkb/xkbActions.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/xkb/xkbActions.c b/xkb/xkbActions.c
index c89baaf..33a0277 100644
--- a/xkb/xkbActions.c
+++ b/xkb/xkbActions.c
@@ -1339,13 +1339,21 @@ XkbHandleActions(DeviceIntPtr dev, DeviceIntPtr kbd, DeviceEvent *event)
         }
         xkbi->flags &= ~_XkbStateNotifyInProgress;
     }
+
     changed = XkbIndicatorsToUpdate(dev, changed, FALSE);
     if (changed) {
+        DeviceIntPtr d;
         XkbEventCauseRec cause;
 
         XkbSetCauseKey(&cause, key, event->type);
         XkbUpdateIndicators(dev, changed, FALSE, NULL, &cause);
+
+        nt_list_for_each_entry(d, inputInfo.devices, next) {
+            if (GetMaster(d, MASTER_KEYBOARD) == dev)
+                XkbUpdateKbdModifiersFromMaster(d);
+        }
     }
+
     return;
 }
 
-- 
1.8.4.2



More information about the xorg-devel mailing list