From 6f2dbd950267562a7441262f533aaf1e20e27f86 Mon Sep 17 00:00:00 2001 From: wysiwys <144733119+wysiwys@users.noreply.github.com> Date: Sun, 24 Mar 2024 05:07:18 +0800 Subject: [PATCH] rules: fix variant index being ignored for layout index (#475) We accidentally ignored the variant index and used the layout index instead. In realistic rules they are always the same but don't have to be. --- src/xkbcomp/rules.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xkbcomp/rules.c b/src/xkbcomp/rules.c index 5bcfa22a..4d819d11 100644 --- a/src/xkbcomp/rules.c +++ b/src/xkbcomp/rules.c @@ -879,7 +879,7 @@ matcher_rule_apply_if_matches(struct matcher *m, struct scanner *s) matched = match_value_and_mark(m, value, to, match_type); } else if (mlvo == MLVO_VARIANT) { - xkb_layout_index_t idx = m->mapping.layout_idx; + xkb_layout_index_t idx = m->mapping.variant_idx; idx = (idx == XKB_LAYOUT_INVALID ? 0 : idx); to = &darray_item(m->rmlvo.variants, idx); matched = match_value_and_mark(m, value, to, match_type);