types: don't compute effective masks here as well

After compiling all of the sections, UpdateModifiersFromCompat does all
of the vmod -> real mods translations, including types/kt_entries.

keytypes.c also has code that does that, but it's unneeded:
- Later sections don't look at their effective masks, so doing it later
  is fine.
- When this code is executed, the vmods -> real mods mapping is empty
  (that is set up later), so VModsToReal has no effect here.
So we can just remove it.

However UpdateModifiersFromCompat didn't update the preserve mask, so do
that.

Signed-off-by: Ran Benita <ran234@gmail.com>
master
Ran Benita 2012-08-09 01:30:22 +03:00
parent fafc1132d2
commit 41478b4309
2 changed files with 8 additions and 27 deletions

View File

@ -1505,10 +1505,13 @@ UpdateModifiersFromCompat(struct xkb_keymap *keymap)
type->mods.mask |= VModsToReal(keymap, type->mods.vmods);
for (j = 0; j < type->num_entries; j++) {
type->map[j].mods.mask = 0;
type->map[j].mods.mask |= type->map[j].mods.real_mods;
type->map[j].mods.mask |= VModsToReal(keymap,
type->map[j].mods.vmods);
struct xkb_kt_map_entry *entry = &type->map[j];
entry->mods.mask = entry->mods.real_mods;
entry->mods.mask |= VModsToReal(keymap, entry->mods.vmods);
entry->preserve.mask = entry->preserve.real_mods;
entry->preserve.mask |= VModsToReal(keymap, entry->preserve.vmods);
}
}

View File

@ -876,28 +876,6 @@ HandleKeyTypesFile(KeyTypesInfo *info, XkbFile *file, enum merge_mode merge)
}
}
static bool
ComputeEffectiveMap(struct xkb_keymap *keymap, struct xkb_key_type *type)
{
unsigned int i;
struct xkb_kt_map_entry *entry;
type->mods.mask = type->mods.real_mods;
type->mods.mask |= VModsToReal(keymap, type->mods.vmods);
for (i = 0; i < type->num_entries; i++) {
entry = &type->map[i];
entry->mods.mask = entry->mods.real_mods;
entry->mods.mask |= VModsToReal(keymap, entry->mods.vmods);
entry->preserve.mask = entry->preserve.real_mods;
entry->preserve.mask |= VModsToReal(keymap, entry->preserve.vmods);
}
return true;
}
static bool
CopyDefToKeyType(KeyTypesInfo *info, KeyTypeInfo *def,
struct xkb_key_type *type)
@ -912,7 +890,7 @@ CopyDefToKeyType(KeyTypesInfo *info, KeyTypeInfo *def,
type->level_names = darray_mem(def->level_names, 0);
darray_init(def->level_names);
return ComputeEffectiveMap(info->keymap, type);
return true;
}
bool