From 771f97d07444dd36ee4c9431d785a040c28cf81a Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Thu, 11 Sep 2014 22:04:21 +0200 Subject: [PATCH] When overriding a key, adjust also its number of levels (#57242). Specifying an explicit key type when overriding a key should adjust the number of levels to that of the specified type. This gets rid of the age-old warning of the right Alt key being ONE_LEVEL but having two symbols assigned. Fixes bug #57242 . Signed-off-by: Benno Schulenberg Reviewed-by: Ran Benita --- symbols.c | 15 ++++++++------- 1 files changed, 8 insertions(+), 7 deletions(-) diff --git a/symbols.c b/symbols.c index d43ba9f..9313d3c 100644 --- a/symbols.c +++ b/symbols.c @@ -339,18 +339,19 @@ MergeKeyGroups(SymbolsInfo * info, clobber = (from->defs.merge != MergeAugment); report = (warningLevel > 9) || ((into->defs.fileID == from->defs.fileID) && (warningLevel > 0)); - if (into->numLevels[group] >= from->numLevels[group]) - { - resultSyms = into->syms[group]; - resultActs = into->acts[group]; - resultWidth = into->numLevels[group]; - } - else + if ((from->numLevels[group] > into->numLevels[group]) + || (clobber && (from->types[group] != None))) { resultSyms = from->syms[group]; resultActs = from->acts[group]; resultWidth = from->numLevels[group]; } + else + { + resultSyms = into->syms[group]; + resultActs = into->acts[group]; + resultWidth = into->numLevels[group]; + } if (resultSyms == NULL) { resultSyms = uTypedCalloc(resultWidth, KeySym); -- 1.7.0.4