From 771cff23fb70873dbf5a5690f0bc20e545d1b839 Mon Sep 17 00:00:00 2001 From: Ragnar Groot Koerkamp Date: Thu, 17 Jun 2021 15:01:51 +0200 Subject: Fix #6299 Disable auto_back_and_forth for next_on_output This forces no_auto_back_and_forth to true for `workspace next_on_output` and `workspace prev_on_output` to keep parity with i3. In i3, running next_on_output never changes focus to another output. In Sway currently, with workspace_auto_back_and_forth set to yet, running next_on_output on an output with only a single active workspace will typically end up focussing the other output: 1. next_on_output focusses the current workspace, because it's the only one 2. auto_back_and_forth focusses the last focussed workspace, because the current workspace to focus is the current one. This will usually be on the other monitor if the workspace there was last focussed. --- sway/commands/workspace.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sway') diff --git a/sway/commands/workspace.c b/sway/commands/workspace.c index 2858a284..bf6b7e04 100644 --- a/sway/commands/workspace.c +++ b/sway/commands/workspace.c @@ -215,8 +215,10 @@ struct cmd_results *cmd_workspace(int argc, char **argv) { ws = workspace_by_name(argv[0]); } else if (strcasecmp(argv[0], "next_on_output") == 0) { ws = workspace_output_next(current, create); + no_auto_back_and_forth = true; } else if (strcasecmp(argv[0], "prev_on_output") == 0) { ws = workspace_output_prev(current, create); + no_auto_back_and_forth = true; } else if (strcasecmp(argv[0], "back_and_forth") == 0) { if (!seat->prev_workspace_name) { return cmd_results_new(CMD_INVALID, -- cgit v1.2.3