Commit af261cb605a038170af0842b6b4c5b2eb1d0b03e

Ran Benita 2014-02-16T10:22:32

action: fix SwitchScreen "same" field handling This used to *unset* a flag called "SwitchApplication"; we changed the flag to "same" but forgot to switch the cases. Signed-off-by: Ran Benita <ran234@gmail.com>

diff --git a/src/x11/keymap.c b/src/x11/keymap.c
index 57f2412..49ff132 100644
--- a/src/x11/keymap.c
+++ b/src/x11/keymap.c
@@ -266,7 +266,7 @@ translate_action(union xkb_action *action, const xcb_xkb_action_t *wire)
 
         action->screen.screen = wire->switchscreen.newScreen;
 
-        if (wire->switchscreen.flags & XCB_XKB_SWITCH_SCREEN_FLAG_APPLICATION)
+        if (!(wire->switchscreen.flags & XCB_XKB_SWITCH_SCREEN_FLAG_APPLICATION))
             action->screen.flags |= ACTION_SAME_SCREEN;
         if (wire->switchscreen.flags & XCB_XKB_SWITCH_SCREEN_FLAG_ABSOLUTE)
             action->screen.flags |= ACTION_ABSOLUTE_SWITCH;
diff --git a/src/xkbcomp/action.c b/src/xkbcomp/action.c
index 0aad747..ad7f43f 100644
--- a/src/xkbcomp/action.c
+++ b/src/xkbcomp/action.c
@@ -118,6 +118,7 @@ NewActionsInfo(void)
     /* Increment default button. */
     info->actions[ACTION_TYPE_PTR_DEFAULT].dflt.flags = 0;
     info->actions[ACTION_TYPE_PTR_DEFAULT].dflt.value = 1;
+    info->actions[ACTION_TYPE_SWITCH_VT].screen.flags = ACTION_SAME_SCREEN;
 
     return info;
 }
@@ -642,9 +643,9 @@ HandleSwitchScreen(struct xkb_keymap *keymap, union xkb_action *action,
             return ReportMismatch(keymap->ctx, action->type, field, "boolean");
 
         if (set)
-            act->flags &= ~ACTION_SAME_SCREEN;
-        else
             act->flags |= ACTION_SAME_SCREEN;
+        else
+            act->flags &= ~ACTION_SAME_SCREEN;
 
         return true;
     }
diff --git a/src/xkbcomp/keymap-dump.c b/src/xkbcomp/keymap-dump.c
index 0163bef..9e25ede 100644
--- a/src/xkbcomp/keymap-dump.c
+++ b/src/xkbcomp/keymap-dump.c
@@ -372,7 +372,7 @@ write_action(struct xkb_keymap *keymap, struct buf *buf,
         write_buf(buf, "%s%s(screen=%s%d,%ssame)%s", prefix, type,
                   (!(action->screen.flags & ACTION_ABSOLUTE_SWITCH) && action->screen.screen >= 0) ? "+" : "",
                   action->screen.screen,
-                  (action->screen.flags & ACTION_SAME_SCREEN) ? "!" : "",
+                  (action->screen.flags & ACTION_SAME_SCREEN) ? "" : "!",
                   suffix);
         break;