summaryrefslogtreecommitdiff
path: root/symbols.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@redhat.com>2008-08-19 16:33:03 +0930
committerPeter Hutterer <peter.hutterer@redhat.com>2008-08-22 12:59:13 +0930
commit36fecff588199a3a6c007f09ff709f3148d40f77 (patch)
treeaafaffb51499cad5d530e35c36183d57bcd8d46f /symbols.c
parentd0dfd26e81aef53e9adf5fd6372d69e2ac7a8f9c (diff)
downloadxorg-app-xkbcomp-36fecff588199a3a6c007f09ff709f3148d40f77.tar.gz
Don't overwrite previously assigned type indices with useless ones.
The default type for a key with no levels is ONE_LEVEL. Let's not overwrite the kt_index with this default type if we have previously assigned a real type. Reproduceable by running setxkbmap -layout "ru(phonetic),us", the first group is assigned ONE_LEVEL and shift stops working. Red Hat Bug #436626 <https://bugzilla.redhat.com/show_bug.cgi?id=436626>
Diffstat (limited to 'symbols.c')
-rw-r--r--symbols.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/symbols.c b/symbols.c
index e11ba85..47ad67b 100644
--- a/symbols.c
+++ b/symbols.c
@@ -2079,8 +2079,15 @@ CopySymbolsDef(XkbFileInfo * result, KeyInfo * key, int start_from)
xkb->map->key_sym_map[kc].width = width;
for (i = 0; i < nGroups; i++)
{
- /* assign kt_index[i] to the index of the type in map->types */
- xkb->map->key_sym_map[kc].kt_index[i] = types[i];
+ /* assign kt_index[i] to the index of the type in map->types.
+ * kt_index[i] may have been set by a previous run (if we have two
+ * layouts specified). Let's not overwrite it with the ONE_LEVEL
+ * default group if we dont even have keys for this group anyway.
+ *
+ * FIXME: There should be a better fix for this.
+ */
+ if (key->numLevels[i])
+ xkb->map->key_sym_map[kc].kt_index[i] = types[i];
if (key->syms[i] != NULL)
{
/* fill key to "width" symbols*/