Commit 16f2de8bf024da264cbf7b6460ab729dd37f6849

Ran Benita 2012-08-14T16:26:30

compat: ignore "locking" field in sym interprets This field is used in conjunction with key behaviors, which we don't support since c1ea23da5. This is also unused in xkeyboard-config. Signed-off-by: Ran Benita <ran234@gmail.com>

diff --git a/src/keymap-dump.c b/src/keymap-dump.c
index f406f31..897bf21 100644
--- a/src/keymap-dump.c
+++ b/src/keymap-dump.c
@@ -548,7 +548,6 @@ write_compat(struct xkb_keymap *keymap, struct buf *buf)
 
     write_buf(buf, "\t\tinterpret.useModMapMods= AnyLevel;\n");
     write_buf(buf, "\t\tinterpret.repeat= False;\n");
-    write_buf(buf, "\t\tinterpret.locking= False;\n");
 
     darray_foreach(interp, keymap->sym_interpret) {
         char keysym_name[64];
@@ -571,8 +570,6 @@ write_compat(struct xkb_keymap *keymap, struct buf *buf)
         if (interp->match & XkbSI_LevelOneOnly)
             write_buf(buf,
                       "\t\t\tuseModMapMods=level1;\n");
-        if (interp->flags & XkbSI_LockingKey)
-            write_buf(buf, "\t\t\tlocking= True;\n");
         if (interp->flags & XkbSI_AutoRepeat)
             write_buf(buf, "\t\t\trepeat= True;\n");
 
diff --git a/src/xkbcomp/compat.c b/src/xkbcomp/compat.c
index 7779bf0..2164377 100644
--- a/src/xkbcomp/compat.c
+++ b/src/xkbcomp/compat.c
@@ -139,8 +139,7 @@ enum si_field {
     SI_FIELD_VIRTUAL_MOD    = (1 << 0),
     SI_FIELD_ACTION         = (1 << 1),
     SI_FIELD_AUTO_REPEAT    = (1 << 2),
-    SI_FIELD_LOCKING_KEY    = (1 << 3),
-    SI_FIELD_LEVEL_ONE_ONLY = (1 << 4),
+    SI_FIELD_LEVEL_ONE_ONLY = (1 << 3),
 };
 
 typedef struct _SymInterpInfo {
@@ -402,12 +401,6 @@ AddInterp(CompatInfo *info, SymInterpInfo *new)
             old->interp.flags |= (new->interp.flags & XkbSI_AutoRepeat);
             old->defined |= SI_FIELD_AUTO_REPEAT;
         }
-        if (UseNewInterpField(SI_FIELD_LOCKING_KEY, old, new, verbosity,
-                              &collide)) {
-            old->interp.flags &= ~XkbSI_LockingKey;
-            old->interp.flags |= (new->interp.flags & XkbSI_LockingKey);
-            old->defined |= SI_FIELD_LOCKING_KEY;
-        }
         if (UseNewInterpField(SI_FIELD_LEVEL_ONE_ONLY, old, new, verbosity,
                               &collide)) {
             old->interp.match &= ~XkbSI_LevelOneOnly;
@@ -767,20 +760,9 @@ SetInterpField(CompatInfo *info, SymInterpInfo *si, const char *field,
         si->defined |= SI_FIELD_AUTO_REPEAT;
     }
     else if (istreq(field, "locking")) {
-        bool set;
-
-        if (arrayNdx)
-            return ReportSINotArray(info, si, field);
-
-        if (!ExprResolveBoolean(keymap->ctx, value, &set))
-            return ReportSIBadType(info, si, field, "boolean");
-
-        if (set)
-            si->interp.flags |= XkbSI_LockingKey;
-        else
-            si->interp.flags &= ~XkbSI_LockingKey;
-
-        si->defined |= SI_FIELD_LOCKING_KEY;
+        log_dbg(info->keymap->ctx,
+                "The \"locking\" field in symbol interpretation is unsupported; "
+                "Ignored\n");
     }
     else if (istreq(field, "usemodmap") ||
              istreq(field, "usemodmapmods")) {
diff --git a/test/data/keymaps/stringcomp.data b/test/data/keymaps/stringcomp.data
index 72234d4..110cece 100644
--- a/test/data/keymaps/stringcomp.data
+++ b/test/data/keymaps/stringcomp.data
@@ -596,7 +596,6 @@ xkb_keymap {
 
 		interpret.useModMapMods= AnyLevel;
 		interpret.repeat= False;
-		interpret.locking= False;
 		interpret ISO_Level2_Latch+Exactly(Shift) {
 			useModMapMods=level1;
 			action= LatchMods(modifiers=Shift,clearLocks,latchToLock);