Commit 461f8a7697695e2455a7da929a5966f7a98dcedc

Daniel Stone 2012-09-10T20:40:05

actions: Remove PointerDefault affect field This was always set to affect the default button, so no need for it. Signed-off-by: Daniel Stone <daniel@fooishbar.org>

diff --git a/src/keymap-dump.c b/src/keymap-dump.c
index 6a139a1..0a478f2 100644
--- a/src/keymap-dump.c
+++ b/src/keymap-dump.c
@@ -466,11 +466,10 @@ write_action(struct xkb_keymap *keymap, struct buf *buf,
 
     case ACTION_TYPE_PTR_DEFAULT:
         write_buf(buf, "%s%s(", prefix, type);
-        if (action->dflt.affect == XkbSA_AffectDfltBtn)
-            write_buf(buf, "affect=button,button=%s%d",
-                      (!(action->dflt.flags & ACTION_ABSOLUTE_SWITCH) &&
-                       action->dflt.value >= 0) ? "+" : "",
-                      action->dflt.value);
+        write_buf(buf, "affect=button,button=%s%d",
+                  (!(action->dflt.flags & ACTION_ABSOLUTE_SWITCH) &&
+                   action->dflt.value >= 0) ? "+" : "",
+                  action->dflt.value);
         write_buf(buf, ")%s", suffix);
         break;
 
diff --git a/src/xkb-priv.h b/src/xkb-priv.h
index a36ebbe..95f1348 100644
--- a/src/xkb-priv.h
+++ b/src/xkb-priv.h
@@ -192,7 +192,6 @@ struct xkb_controls_action {
 struct xkb_pointer_default_action {
     enum xkb_action_type type;
     enum xkb_action_flags flags;
-    uint8_t affect;
     int8_t value;
 };
 
diff --git a/src/xkbcomp/action.c b/src/xkbcomp/action.c
index f5b3264..98484b0 100644
--- a/src/xkbcomp/action.c
+++ b/src/xkbcomp/action.c
@@ -87,7 +87,6 @@ NewActionsInfo(void)
     /* Apply some "factory defaults". */
 
     /* Increment default button. */
-    info->actions[ACTION_TYPE_PTR_DEFAULT].dflt.affect = XkbSA_AffectDfltBtn;
     info->actions[ACTION_TYPE_PTR_DEFAULT].dflt.flags = 0;
     info->actions[ACTION_TYPE_PTR_DEFAULT].dflt.value = 1;
 
@@ -558,9 +557,9 @@ HandlePtrBtn(struct xkb_keymap *keymap, union xkb_action *action,
 }
 
 static const LookupEntry ptrDflts[] = {
-    { "dfltbtn", XkbSA_AffectDfltBtn },
-    { "defaultbutton", XkbSA_AffectDfltBtn },
-    { "button", XkbSA_AffectDfltBtn },
+    { "dfltbtn", 1 },
+    { "defaultbutton", 1 },
+    { "button", 1 },
     { NULL, 0 }
 };
 
@@ -580,7 +579,6 @@ HandleSetPtrDflt(struct xkb_keymap *keymap, union xkb_action *action,
         if (!ExprResolveEnum(keymap->ctx, value, &val, ptrDflts))
             return ReportMismatch(keymap, action->type, field,
                                   "pointer component");
-        act->affect = val;
         return true;
     }
     else if (field == ACTION_FIELD_BUTTON || field == ACTION_FIELD_VALUE) {