vmod: remove support for direct vmod -> real mod mapping The current code supports statements such as: virtual_modifiers NumLock = Mod2; This would set the mapping from the NumLock vmod to the Mod2 real mod directly, without going through the virtualModifier field in an interpret statement (in xkb_compat) or vmods field in a key statement (in xkb_symbols). This is undocumented, unused and complicates things, so remove it. Signed-off-by: Ran Benita <ran234@gmail.com>
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 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
diff --git a/src/xkbcomp/vmod.c b/src/xkbcomp/vmod.c
index 3560d70..7ce943c 100644
--- a/src/xkbcomp/vmod.c
+++ b/src/xkbcomp/vmod.c
@@ -55,10 +55,8 @@ ClearVModInfo(VModInfo *info, struct xkb_keymap *keymap)
/**
* Handle one entry in the virtualModifiers line (e.g. NumLock).
- * If the entry is e.g. NumLock=Mod1, stmt->value is not NULL, and the
- * XkbServerMap's vmod is set to the given modifier. Otherwise, the vmod is 0.
*
- * @param stmt The statement specifying the name and (if any the value).
+ * @param stmt The statement specifying the name
* @param mergeMode Merge strategy (e.g. MERGE_OVERRIDE)
*/
bool
@@ -68,13 +66,14 @@ HandleVModDef(VModDef *stmt, struct xkb_keymap *keymap,
xkb_mod_index_t i;
int nextFree;
xkb_mod_mask_t bit;
- xkb_mod_mask_t mask;
+
+ if (stmt->value)
+ log_err(keymap->ctx,
+ "Support for setting a value in a virtual_modifiers statement has been removed; "
+ "Value ignored\n");
nextFree = -1;
for (i = 0, bit = 1; i < XkbNumVirtualMods; i++, bit <<= 1) {
- const char *str1;
- const char *str2 = "";
-
if (!(info->defined & bit)) {
if (nextFree < 0)
nextFree = i;
@@ -90,33 +89,6 @@ HandleVModDef(VModDef *stmt, struct xkb_keymap *keymap,
continue;
info->available |= bit;
-
- if (!stmt->value)
- return true;
-
- if (!ExprResolveModMask(keymap->ctx, stmt->value, &mask)) {
- log_err(keymap->ctx, "Declaration of %s ignored\n",
- xkb_atom_text(keymap->ctx, stmt->name));
- return false;
- }
-
- if (mask == keymap->vmods[i])
- return true;
-
- str1 = ModMaskText(keymap->vmods[i]);
- if (mergeMode == MERGE_OVERRIDE) {
- str2 = str1;
- str1 = ModMaskText(mask);
- }
-
- log_warn(keymap->ctx,
- "Virtual modifier %s defined multiple times; "
- "Using %s, ignoring %s\n",
- xkb_atom_text(keymap->ctx, stmt->name), str1, str2);
-
- if (mergeMode == MERGE_OVERRIDE)
- keymap->vmods[i] = mask;
-
return true;
}
@@ -131,17 +103,6 @@ HandleVModDef(VModDef *stmt, struct xkb_keymap *keymap,
info->available |= (1 << nextFree);
keymap->vmod_names[nextFree] = xkb_atom_text(keymap->ctx, stmt->name);
-
- if (!stmt->value)
- return true;
-
- if (!ExprResolveModMask(keymap->ctx, stmt->value, &mask)) {
- log_err(keymap->ctx, "Declaration of %s ignored\n",
- xkb_atom_text(keymap->ctx, stmt->name));
- return false;
- }
-
- keymap->vmods[nextFree] = mask;
return true;
}