diff options
author | Ran Benita <ran234@gmail.com> | 2012-08-09 01:30:22 +0300 |
---|---|---|
committer | Ran Benita <ran234@gmail.com> | 2012-08-09 01:57:17 +0300 |
commit | 41478b4309a4c69f7b641901849e0379dc23649b (patch) | |
tree | fd6eb3e2b04e41bbd21debf6799cb364356b87ec /src/xkbcomp/compat.c | |
parent | fafc1132d25c0ecf8c406c549d9c2dc894031b1d (diff) | |
download | libxkbcommon-41478b4309a4c69f7b641901849e0379dc23649b.tar.gz libxkbcommon-41478b4309a4c69f7b641901849e0379dc23649b.tar.bz2 libxkbcommon-41478b4309a4c69f7b641901849e0379dc23649b.zip |
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>
Diffstat (limited to 'src/xkbcomp/compat.c')
-rw-r--r-- | src/xkbcomp/compat.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/xkbcomp/compat.c b/src/xkbcomp/compat.c index b877b91..bbd03e1 100644 --- a/src/xkbcomp/compat.c +++ b/src/xkbcomp/compat.c @@ -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); } } |