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 /include | |
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 'include')
-rw-r--r-- | include/sway/tree/workspace.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/sway/tree/workspace.h b/include/sway/tree/workspace.h index 239cbbdb..056f2329 100644 --- a/include/sway/tree/workspace.h +++ b/include/sway/tree/workspace.h | |||
@@ -16,6 +16,8 @@ struct sway_workspace { | |||
16 | 16 | ||
17 | extern char *prev_workspace_name; | 17 | extern char *prev_workspace_name; |
18 | 18 | ||
19 | struct sway_container *workspace_get_initial_output(const char *name); | ||
20 | |||
19 | char *workspace_next_name(const char *output_name); | 21 | char *workspace_next_name(const char *output_name); |
20 | 22 | ||
21 | bool workspace_switch(struct sway_container *workspace, | 23 | bool workspace_switch(struct sway_container *workspace, |