diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-08-08 10:04:11 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-08-08 12:50:42 +1000 |
commit | 5653fc754b09ae5344f42f9e3df71cd4420b7d61 (patch) | |
tree | 2f70bd11f025791a2970850771baa2062413f00c /sway/tree/workspace.c | |
parent | Fix edge cases when moving floating container to new workspace (diff) | |
download | sway-5653fc754b09ae5344f42f9e3df71cd4420b7d61.tar.gz sway-5653fc754b09ae5344f42f9e3df71cd4420b7d61.tar.zst sway-5653fc754b09ae5344f42f9e3df71cd4420b7d61.zip |
Deny moving a sticky container to workspace if it's the same output
Rationale: Sticky containers are always assigned to the visible
workspace.
The basic idea here is to check the destination's output (move.c:190).
But if the command was `move container to workspace x` then a workspace
might have been created for it. We could destroy the workspace in this
case, but that results in unnecessary IPC events.
To avoid this, the logic for `move container to workspace x` has been
adjusted. It now delays creating the workspace until the end, and uses
`workspace_get_initial_output` to determine and check the output before
creating it.
Diffstat (limited to 'sway/tree/workspace.c')
-rw-r--r-- | sway/tree/workspace.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sway/tree/workspace.c b/sway/tree/workspace.c index 395c6c10..b8bec044 100644 --- a/sway/tree/workspace.c +++ b/sway/tree/workspace.c | |||
@@ -18,7 +18,7 @@ | |||
18 | #include "log.h" | 18 | #include "log.h" |
19 | #include "util.h" | 19 | #include "util.h" |
20 | 20 | ||
21 | static struct sway_container *get_workspace_initial_output(const char *name) { | 21 | struct sway_container *workspace_get_initial_output(const char *name) { |
22 | struct sway_container *parent; | 22 | struct sway_container *parent; |
23 | // Search for workspace<->output pair | 23 | // Search for workspace<->output pair |
24 | int e = config->workspace_outputs->length; | 24 | int e = config->workspace_outputs->length; |
@@ -48,7 +48,7 @@ static struct sway_container *get_workspace_initial_output(const char *name) { | |||
48 | struct sway_container *workspace_create(struct sway_container *output, | 48 | struct sway_container *workspace_create(struct sway_container *output, |
49 | const char *name) { | 49 | const char *name) { |
50 | if (output == NULL) { | 50 | if (output == NULL) { |
51 | output = get_workspace_initial_output(name); | 51 | output = workspace_get_initial_output(name); |
52 | } | 52 | } |
53 | 53 | ||
54 | wlr_log(WLR_DEBUG, "Added workspace %s for output %s", name, output->name); | 54 | wlr_log(WLR_DEBUG, "Added workspace %s for output %s", name, output->name); |