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>
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
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;