[PATCH] [xserver] xkb: Cancel a key's repetition when its autorepeat is disabled.
Erkki Seppälä
erkki.seppala at vincit.fi
Fri Jan 21 00:11:41 PST 2011
When XkbChangeEnabledControls is called to disable key repetition of a
certain key (or keys), currently ongoing repetition of that key was
not cancelled. It was cancelled if ChangeKeyboardControl was used to
disable key repetition globally.
Signed-off-by: Erkki Seppälä <erkki.seppala at vincit.fi>
---
xkb/xkb.c | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/xkb/xkb.c b/xkb/xkb.c
index 7d95bc0..4a2590b 100644
--- a/xkb/xkb.c
+++ b/xkb/xkb.c
@@ -915,9 +915,19 @@ ProcXkbSetControls(ClientPtr client)
stuff->axtOptsMask);
}
- if (stuff->changeCtrls & XkbPerKeyRepeatMask)
+ if (stuff->changeCtrls & XkbPerKeyRepeatMask) {
+ unsigned key;
+
memcpy(new.per_key_repeat, stuff->perKeyRepeat,
XkbPerKeyBitArraySize);
+ for (key = 0; key < 8 * XkbPerKeyBitArraySize; ++key) {
+ unsigned idx = key / 8;
+ unsigned bit = key % 8;
+ if (!(new.per_key_repeat[idx] & (1 << bit))) {
+ AccessXCancelRepeatKey(xkbi, key);
+ }
+ }
+ }
old= *ctrl;
*ctrl= new;
--
1.7.0.4
More information about the xorg-devel
mailing list