Fix non-useModMapMods action masks By ensuring their mask is only the vmods, rather than also potentially including the key's modmap. Also remove the unnecessary vmodmask indirection. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
diff --git a/src/xkbcomp/compat.c b/src/xkbcomp/compat.c
index fd80d8a..044c715 100644
--- a/src/xkbcomp/compat.c
+++ b/src/xkbcomp/compat.c
@@ -871,8 +871,6 @@ VModsToReal(struct xkb_desc *xkb, uint32_t vmodmask)
static void
UpdateActionMods(struct xkb_desc *xkb, union xkb_action *act, uint32_t rmodmask)
{
- uint32_t vmodmask; /* actually real mods, inferred from vmods */
-
switch (act->type) {
case XkbSA_SetMods:
case XkbSA_LatchMods:
@@ -881,16 +879,20 @@ UpdateActionMods(struct xkb_desc *xkb, union xkb_action *act, uint32_t rmodmask)
act->mods.real_mods = rmodmask;
act->mods.mask = act->mods.real_mods;
}
- vmodmask = VModsToReal(xkb, act->mods.vmods);
- act->mods.mask |= vmodmask;
+ else {
+ act->mods.mask = 0;
+ }
+ act->mods.mask |= VModsToReal(xkb, act->mods.vmods);
break;
case XkbSA_ISOLock:
if (act->iso.flags & XkbSA_UseModMapMods) {
act->iso.real_mods = rmodmask;
act->iso.mask = act->iso.real_mods;
}
- vmodmask = VModsToReal(xkb, act->iso.vmods);
- act->iso.mask |= vmodmask;
+ else {
+ act->iso.mask = 0;
+ }
+ act->iso.mask |= VModsToReal(xkb, act->iso.vmods);
break;
default:
break;