aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/workspace.c
diff options
context:
space:
mode:
authorLibravatar mwenzkowski <29407878+mwenzkowski@users.noreply.github.com>2020-10-28 00:02:08 +0100
committerLibravatar Tudor Brindus <me@tbrindus.ca>2020-10-27 19:26:26 -0400
commit32788a93f23eaa683f7a88694c778cd084607754 (patch)
treedf3ecb3274ccc953c28445e483b24ca22cec9c10 /sway/tree/workspace.c
parentSmart borders fix: always show borders for floating containers (diff)
downloadsway-32788a93f23eaa683f7a88694c778cd084607754.tar.gz
sway-32788a93f23eaa683f7a88694c778cd084607754.tar.zst
sway-32788a93f23eaa683f7a88694c778cd084607754.zip
output: evacuate sticky containers only if new output has a workspace
Sticky floating containers on an otherwise empty workspace can only be evacuated if the new output has an active workspace. The noop output may not have one and in that case we have to move the whole workspace to the new output.
Diffstat (limited to 'sway/tree/workspace.c')
-rw-r--r--sway/tree/workspace.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/sway/tree/workspace.c b/sway/tree/workspace.c
index 3bcba8e5..476c2568 100644
--- a/sway/tree/workspace.c
+++ b/sway/tree/workspace.c
@@ -817,3 +817,16 @@ size_t workspace_num_tiling_views(struct sway_workspace *ws) {
817 workspace_for_each_container(ws, count_tiling_views, &count); 817 workspace_for_each_container(ws, count_tiling_views, &count);
818 return count; 818 return count;
819} 819}
820
821static void count_sticky_containers(struct sway_container *con, void *data) {
822 if (container_is_floating(con) && con->is_sticky) {
823 size_t *count = data;
824 *count += 1;
825 }
826}
827
828size_t workspace_num_sticky_containers(struct sway_workspace *ws) {
829 size_t count = 0;
830 workspace_for_each_container(ws, count_sticky_containers, &count);
831 return count;
832}