diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2011-01-13 12:20:38 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-01-21 09:07:09 +1000 |
commit | 64237697994871adfcf4905b5784e75cd7281579 (patch) | |
tree | 5079e4e9295946570b62aba258cc5afe14cbcf6c /xkb | |
parent | f1326ed2910bd985fafdb48714b1d6f38116b083 (diff) |
xkb: after making changes to the xkb ctrls, copy them back into kbdfeed.
enabled_ctrls_changes nowhere near the usual event or config paths. So this
condition always evaluated to false and the memcpy would thus never been
hit. As a result, any modification to the XKB struct during
XkbUpdateDescActions was not reflected in the kbdfeed ctrls.
The flag that is set by XkbUpdateDescActions() if ctrls were changed are in
enabled_ctrls.
This mainly affected keyboard repeat control as XKB uses the kbdfeed ctrls,
not XKB's per_key_repeats, to determine if a key needs to be repeated. Thus,
adding a "repeat= False" to the XKB map of any action did not have any
effect.
Test case:
assign Mode_switch to any key that by default repeats, e.g. the menu key.
key <COMP> { [ Mode_switch ] };
Then modify the Mode_switch action to not repeat the key.
interpret Mode_switch+AnyOfOrNone(all) {
virtualModifier= AltGr;
useModMapMods=level1;
action= SetGroup(group=+1);
// Add this line
repeat= False;
};
Though the flags are correctly reflected in the description loaded in the
server, the change is not handed back to the kbdfeed struct and XKB will
trigger softrepeats of this key.
This patch also adds two explanatory comments and an extra check, as this
path may be hit before the CtrlProc for the kbdfeed struct is set.
Red Hat Bug 537708 <https://bugzilla.redhat.com/show_bug.cgi?id=537708>
Also fixes broken auto-repeat of the backspace key in the colemak layout
(mapped to CapsLock).
X.Org Bug 16318 <http://bugs.freedesktop.org/show_bug.cgi?id=16318>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Dirk Wallenstein <halsmit@t-online.de>
Reviewed-by: Dirk Wallenstein <halsmit@t-online.de>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Diffstat (limited to 'xkb')
-rw-r--r-- | xkb/xkbUtils.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/xkb/xkbUtils.c b/xkb/xkbUtils.c index 14dc784b8..3a56bea4c 100644 --- a/xkb/xkbUtils.c +++ b/xkb/xkbUtils.c @@ -342,15 +342,18 @@ CARD8 * repeat; xkb= xkbi->desc; repeat= xkb->ctrls->per_key_repeat; + /* before letting XKB do any changes, copy the current core values */ if (pXDev->kbdfeed) memcpy(repeat,pXDev->kbdfeed->ctrl.autoRepeats,XkbPerKeyBitArraySize); XkbUpdateDescActions(xkb,first,num,changes); if ((pXDev->kbdfeed)&& - (changes->ctrls.enabled_ctrls_changes&XkbPerKeyRepeatMask)) { - memcpy(pXDev->kbdfeed->ctrl.autoRepeats,repeat, XkbPerKeyBitArraySize); - (*pXDev->kbdfeed->CtrlProc)(pXDev, &pXDev->kbdfeed->ctrl); + (changes->ctrls.changed_ctrls&XkbPerKeyRepeatMask)) { + /* now copy the modified changes back to core */ + memcpy(pXDev->kbdfeed->ctrl.autoRepeats,repeat, XkbPerKeyBitArraySize); + if (pXDev->kbdfeed->CtrlProc) + (*pXDev->kbdfeed->CtrlProc)(pXDev, &pXDev->kbdfeed->ctrl); } return; } |