aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Ragnar Groot Koerkamp <ragnar.grootkoerkamp@gmail.com>2021-06-17 15:01:51 +0200
committerLibravatar Simon Ser <contact@emersion.fr>2021-06-18 09:37:28 +0200
commit771cff23fb70873dbf5a5690f0bc20e545d1b839 (patch)
tree2b1209ce452c1325181be0240b3d414a8e933db5
parentswaynag: adds option to set wayland shell layer (diff)
downloadsway-771cff23fb70873dbf5a5690f0bc20e545d1b839.tar.gz
sway-771cff23fb70873dbf5a5690f0bc20e545d1b839.tar.zst
sway-771cff23fb70873dbf5a5690f0bc20e545d1b839.zip
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.
-rw-r--r--sway/commands/workspace.c2
1 files changed, 2 insertions, 0 deletions
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) {
215 ws = workspace_by_name(argv[0]); 215 ws = workspace_by_name(argv[0]);
216 } else if (strcasecmp(argv[0], "next_on_output") == 0) { 216 } else if (strcasecmp(argv[0], "next_on_output") == 0) {
217 ws = workspace_output_next(current, create); 217 ws = workspace_output_next(current, create);
218 no_auto_back_and_forth = true;
218 } else if (strcasecmp(argv[0], "prev_on_output") == 0) { 219 } else if (strcasecmp(argv[0], "prev_on_output") == 0) {
219 ws = workspace_output_prev(current, create); 220 ws = workspace_output_prev(current, create);
221 no_auto_back_and_forth = true;
220 } else if (strcasecmp(argv[0], "back_and_forth") == 0) { 222 } else if (strcasecmp(argv[0], "back_and_forth") == 0) {
221 if (!seat->prev_workspace_name) { 223 if (!seat->prev_workspace_name) {
222 return cmd_results_new(CMD_INVALID, 224 return cmd_results_new(CMD_INVALID,