From bf4d7d059daf5c6f81d70f8d3e5e2a87265381b7 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Thu, 11 Sep 2014 22:04:21 +0200 Subject: 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 Signed-off-by: Peter Hutterer --- symbols.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/symbols.c b/symbols.c index b5738c9..3fe0195 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); -- cgit v1.2.3