Work out a default repeat for all keys
authorDaniel Stone <daniel@fooishbar.org>
Fri, 22 Jun 2012 14:26:07 +0000 (15:26 +0100)
committerDaniel Stone <daniel@fooishbar.org>
Fri, 22 Jun 2012 14:26:07 +0000 (15:26 +0100)
Our early exit in ApplyInterpsToKey meant we weren't hitting the code
that's supposed to set a sensible default autorepeat value for most
keys.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
src/xkbcomp/compat.c

index 51b58a6d85ae3d0dbfa0a5842bd922f0e4f791e4..4765da4154f21c45205b28fcc4e91a54ffc31635 100644 (file)
@@ -973,9 +973,7 @@ ApplyInterpsToKey(struct xkb_keymap *keymap, xkb_keycode_t key)
     if (num_acts)
         num_acts = XkbKeyNumGroups(keymap, key) * width;
     acts = XkbcResizeKeyActions(keymap, key, num_acts);
-    if (!num_acts)
-        return true;
-    else if (!acts)
+    if (num_acts && !acts)
         return false;
 
     for (group = 0; group < XkbKeyNumGroups(keymap, key); group++) {
@@ -988,8 +986,10 @@ ApplyInterpsToKey(struct xkb_keymap *keymap, xkb_keycode_t key)
             /* Infer default key behaviours from the base level. */
             if (group == 0 && level == 0) {
                 if (!(keymap->server->explicit[key] & XkbExplicitAutoRepeatMask) &&
-                    (!interp || interp->flags & XkbSI_AutoRepeat))
-                    keymap->ctrls->per_key_repeat[key / 8] |= (1 << (key % 8));
+                    (!interp || interp->flags & XkbSI_AutoRepeat)) {
+                        keymap->ctrls->per_key_repeat[key / 8] |= (1 << (key % 8));
+                    keymap->server->explicit[key] |= XkbExplicitAutoRepeatMask;
+                }
                 if (!(keymap->server->explicit[key] & XkbExplicitBehaviorMask) &&
                     interp && (interp->flags & XkbSI_LockingKey))
                     keymap->server->behaviors[key].type = XkbKB_Lock;