diff options
author | Ran Benita <ran@unusedvar.com> | 2020-11-23 18:24:52 +0200 |
---|---|---|
committer | Ran Benita <ran@unusedvar.com> | 2020-11-23 18:24:52 +0200 |
commit | 4aed3c6811bfe7be8c4f9d3771a298a5eae7c264 (patch) | |
tree | a3c76fa07a443335a7393405cf12839848549641 /src | |
parent | 13e6543ed427801bc48b8a51c9b54cd9ec90cafb (diff) | |
download | libxkbcommon-4aed3c6811bfe7be8c4f9d3771a298a5eae7c264.tar.gz libxkbcommon-4aed3c6811bfe7be8c4f9d3771a298a5eae7c264.tar.bz2 libxkbcommon-4aed3c6811bfe7be8c4f9d3771a298a5eae7c264.zip |
x11/keymap: fix case with no actions
Possible regression in f41e609bbea8447fc82849a1a6ea0d116189f2f8 (not
confirmed yet).
Signed-off-by: Ran Benita <ran@unusedvar.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/x11/keymap.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/x11/keymap.c b/src/x11/keymap.c index 03a3fab..087ee48 100644 --- a/src/x11/keymap.c +++ b/src/x11/keymap.c @@ -495,18 +495,19 @@ get_actions(struct xkb_keymap *keymap, xcb_connection_t *conn, FAIL_UNLESS((unsigned) syms_length == wire_sym_map->width * key->num_groups); FAIL_UNLESS(wire_count == 0 || wire_count == syms_length); - for (xkb_layout_index_t group = 0; group < key->num_groups; group++) { - for (xkb_level_index_t level = 0; level < wire_sym_map->width; level++) { - xcb_xkb_action_t *wire_action = acts_iter.data; + if (wire_count != 0) { + for (xkb_layout_index_t group = 0; group < key->num_groups; group++) { + for (xkb_level_index_t level = 0; level < wire_sym_map->width; level++) { + xcb_xkb_action_t *wire_action = acts_iter.data; - if (level < key->groups[group].type->num_levels) { - union xkb_action *action = - &key->groups[group].levels[level].action; + if (level < key->groups[group].type->num_levels) { + union xkb_action *action = &key->groups[group].levels[level].action; - translate_action(action, wire_action); - } + translate_action(action, wire_action); + } - xcb_xkb_action_next(&acts_iter); + xcb_xkb_action_next(&acts_iter); + } } } |