Fix non-useModMapMods action masks
authorDaniel Stone <daniel@fooishbar.org>
Fri, 16 Mar 2012 13:59:24 +0000 (13:59 +0000)
committerDaniel Stone <daniel@fooishbar.org>
Fri, 16 Mar 2012 13:59:24 +0000 (13:59 +0000)
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>
src/xkbcomp/compat.c

index fd80d8a..044c715 100644 (file)
@@ -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;