[PATCH] xkb: Support NoLock and NoUnlock for LockControls
Andreas Wettstein
wettstein509 at solnet.ch
Sat Feb 15 08:37:08 PST 2014
The XKB protocol specification demands support for these flags.
Signed-off-by: Andreas Wettstein <wettstein509 at solnet.ch>
---
xkb/xkbActions.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/xkb/xkbActions.c b/xkb/xkbActions.c
index 89360df..84190df 100644
--- a/xkb/xkbActions.c
+++ b/xkb/xkbActions.c
@@ -688,14 +688,22 @@ _XkbFilterControls(XkbSrvInfoPtr xkbi,
filter->keycode = keycode;
filter->active = 1;
filter->filterOthers = 0;
- change = XkbActionCtrls(&pAction->ctrls);
+ change = (XkbActionCtrls(&pAction->ctrls) & ~ctrls->enabled_ctrls);
filter->priv = change;
filter->filter = _XkbFilterControls;
filter->upAction = *pAction;
if (pAction->type == XkbSA_LockControls) {
- filter->priv = (ctrls->enabled_ctrls & change);
- change &= ~ctrls->enabled_ctrls;
+ if (pAction->ctrls.flags & XkbSA_LockNoUnlock)
+ filter->priv = 0;
+ else
+ /* The protocol specification says we should unlock controls
+ are NOT currently enabled. As this does not make any sense,
+ let's assume this is a typo and do the opposite. */
+ filter->priv = (XkbActionCtrls(&pAction->ctrls) & ctrls->enabled_ctrls);
+
+ if (pAction->ctrls.flags & XkbSA_LockNoLock)
+ change = 0;
}
if (change) {
--
1.8.3.1
More information about the xorg-devel
mailing list