[PATCH REVISED] xkb: Support NoLock and NoUnlock for LockControls

Andreas Wettstein wettstein509 at solnet.ch
Thu Feb 20 11:38:14 PST 2014


The XKB protocol specification demands support for these flags.

Signed-off-by: Andreas Wettstein <wettstein509 at solnet.ch>
---
 xkb/xkbActions.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/xkb/xkbActions.c b/xkb/xkbActions.c
index 382cf7e..21955b6 100644
--- a/xkb/xkbActions.c
+++ b/xkb/xkbActions.c
@@ -759,7 +759,7 @@ _XkbFilterControls(XkbSrvInfoPtr xkbi,
         filter->active = 1;
         filter->filterOthers = 0;
         change = XkbActionCtrls(&pAction->ctrls);
-        filter->priv = change;
+        filter->priv = change & ~ctrls->enabled_ctrls;
         filter->filter = _XkbFilterControls;
         filter->upAction = *pAction;
 
@@ -772,7 +772,10 @@ _XkbFilterControls(XkbSrvInfoPtr xkbi,
             xkbControlsNotify cn;
             XkbSrvLedInfoPtr sli;
 
-            ctrls->enabled_ctrls |= change;
+            if (pAction->type != XkbSA_LockControls ||
+                !(pAction->ctrls.flags & XkbSA_LockNoLock))
+                ctrls->enabled_ctrls |= change;
+
             if (XkbComputeControlsNotify(kbd, &old, ctrls, &cn, FALSE)) {
                 cn.keycode = keycode;
                 /* XXX: what about DeviceKeyPress? */
@@ -801,7 +804,10 @@ _XkbFilterControls(XkbSrvInfoPtr xkbi,
             xkbControlsNotify cn;
             XkbSrvLedInfoPtr sli;
 
-            ctrls->enabled_ctrls &= ~change;
+            if (filter->upAction.type != XkbSA_LockControls ||
+                !(filter->upAction.ctrls.flags & XkbSA_LockNoUnlock))
+                ctrls->enabled_ctrls &= ~change;
+
             if (XkbComputeControlsNotify(kbd, &old, ctrls, &cn, FALSE)) {
                 cn.keycode = keycode;
                 cn.eventType = KeyRelease;
-- 
1.8.3.1



More information about the xorg-devel mailing list