diff options
author | Benno Schulenberg <bensberg@justemail.net> | 2014-09-11 22:04:21 +0200 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2015-11-09 14:39:26 +1000 |
commit | bf4d7d059daf5c6f81d70f8d3e5e2a87265381b7 (patch) | |
tree | ba2a725b92faa15f82c92b2251db937e87cc6080 | |
parent | f909259b1da70bc145f19e5ce595c8e945a2a808 (diff) |
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 <http://bugs.freedesktop.org/show_bug.cgi?id=57242>.
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Reviewed-by: Ran Benita <ran234@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | symbols.c | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -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); |