compat: ignore "index" field in indicator statements The current code allows to set the "index" field in an indicator statment's body. This would bind the indicator to the specified index, instead of by name (which was declared previously in xkb_keycodes). Doing this is a bad idea, for the same reasons as in 3cd9704, and is also happily not used anywhere. 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
diff --git a/src/xkbcomp/compat.c b/src/xkbcomp/compat.c
index 1171d18..862f548 100644
--- a/src/xkbcomp/compat.c
+++ b/src/xkbcomp/compat.c
@@ -152,12 +152,11 @@ typedef struct _SymInterpInfo {
} SymInterpInfo;
enum led_field {
- LED_FIELD_INDEX = (1 << 0),
- LED_FIELD_MODS = (1 << 1),
- LED_FIELD_GROUPS = (1 << 2),
- LED_FIELD_CTRLS = (1 << 3),
- LED_FIELD_EXPLICIT = (1 << 4),
- LED_FIELD_DRIVES_KBD = (1 << 5),
+ LED_FIELD_MODS = (1 << 0),
+ LED_FIELD_GROUPS = (1 << 1),
+ LED_FIELD_CTRLS = (1 << 2),
+ LED_FIELD_EXPLICIT = (1 << 3),
+ LED_FIELD_DRIVES_KBD = (1 << 4),
};
typedef struct _LEDInfo {
@@ -551,11 +550,6 @@ AddIndicatorMap(CompatInfo *info, LEDInfo *new)
}
collide = 0;
- if (UseNewLEDField(LED_FIELD_INDEX, old, new, verbosity,
- &collide)) {
- old->indicator = new->indicator;
- old->defined |= LED_FIELD_INDEX;
- }
if (UseNewLEDField(LED_FIELD_MODS, old, new, verbosity,
&collide)) {
old->which_mods = new->which_mods;
@@ -921,26 +915,10 @@ SetIndicatorMapField(CompatInfo *info, LEDInfo *led,
led->defined |= LED_FIELD_DRIVES_KBD;
}
else if (istreq(field, "index")) {
- int ndx;
-
- if (arrayNdx)
- return ReportIndicatorNotArray(info, led, field);
-
- if (!ExprResolveInteger(keymap->ctx, value, &ndx))
- return ReportIndicatorBadType(info, led, field,
- "indicator index");
-
- if (ndx < 1 || ndx > XkbNumIndicators) {
- log_err(info->keymap->ctx,
- "Illegal indicator index %d (range 1..%d); "
- "Index definition for %s indicator ignored\n",
- ndx, XkbNumIndicators,
- xkb_atom_text(keymap->ctx, led->name));
- return false;
- }
-
- led->indicator = (xkb_led_index_t) ndx;
- led->defined |= LED_FIELD_INDEX;
+ /* Users should see this, it might cause unexpected behavior. */
+ log_err(info->keymap->ctx,
+ "The \"index\" field in indicator statements is unsupported; "
+ "Ignored\n");
}
else {
log_err(info->keymap->ctx,