aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/output.c
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2018-11-11 11:22:38 -0500
committerLibravatar Brian Ashworth <bosrsf04@gmail.com>2018-11-11 11:22:38 -0500
commit12876932a948d7265745efaccafea509bdbaffe8 (patch)
tree458a3acb6db39a78d26b4ce38ea637aa21812e29 /sway/tree/output.c
parentMerge pull request #3098 from c-edw/feature/RefactorArgParse (diff)
downloadsway-12876932a948d7265745efaccafea509bdbaffe8.tar.gz
sway-12876932a948d7265745efaccafea509bdbaffe8.tar.zst
sway-12876932a948d7265745efaccafea509bdbaffe8.zip
Allow multiple outputs for workspace output
`i3 4.16` allows users to list multiple outputs for a workspace and the first available will be used. The syntax is as follows: `workspace <workspace> output <outputs...>` Additionally when the workspace is created, the outputs get added to the output priority list in the order specified. This ensures that if a higher output gets connected, the workspace will move to the higher output. This works the same way as if the user had a workspace on an output, disconnected the output, and then later reconnected the output.
Diffstat (limited to 'sway/tree/output.c')
-rw-r--r--sway/tree/output.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sway/tree/output.c b/sway/tree/output.c
index 2704920d..3c4614a8 100644
--- a/sway/tree/output.c
+++ b/sway/tree/output.c
@@ -31,6 +31,13 @@ static void restore_workspaces(struct sway_output *output) {
31 j--; 31 j--;
32 } 32 }
33 } 33 }
34
35 if (other->workspaces->length == 0) {
36 char *next = workspace_next_name(other->wlr_output->name);
37 struct sway_workspace *ws = workspace_create(other, next);
38 free(next);
39 ipc_event_workspace(NULL, ws, "init");
40 }
34 } 41 }
35 42
36 // Saved workspaces 43 // Saved workspaces