From 12876932a948d7265745efaccafea509bdbaffe8 Mon Sep 17 00:00:00 2001 From: Brian Ashworth Date: Sun, 11 Nov 2018 11:22:38 -0500 Subject: 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 output ` 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. --- sway/tree/output.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sway/tree/output.c') 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) { j--; } } + + if (other->workspaces->length == 0) { + char *next = workspace_next_name(other->wlr_output->name); + struct sway_workspace *ws = workspace_create(other, next); + free(next); + ipc_event_workspace(NULL, ws, "init"); + } } // Saved workspaces -- cgit v1.2.3