aboutsummaryrefslogtreecommitdiff
path: root/sway/tree/workspace.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/tree/workspace.c')
-rw-r--r--sway/tree/workspace.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/sway/tree/workspace.c b/sway/tree/workspace.c
index c4f8ac5e..5bef409a 100644
--- a/sway/tree/workspace.c
+++ b/sway/tree/workspace.c
@@ -65,7 +65,9 @@ struct sway_container *workspace_create(struct sway_container *output,
return NULL;
}
swayws->swayc = workspace;
- swayws->floating = create_list();
+ swayws->floating = container_create(C_CONTAINER);
+ swayws->floating->parent = swayws->swayc;
+ swayws->floating->reapable = false;
workspace->sway_workspace = swayws;
container_add_child(output, workspace);
@@ -408,3 +410,16 @@ bool workspace_is_visible(struct sway_container *ws) {
}
return focus == ws;
}
+
+bool workspace_is_empty(struct sway_container *ws) {
+ if (!sway_assert(ws->type == C_WORKSPACE, "Expected a workspace")) {
+ return false;
+ }
+ if (ws->children->length) {
+ return false;
+ }
+ if (ws->sway_workspace->floating->children->length) {
+ return false;
+ }
+ return true;
+}