diff options
author | Ryan Dwyer <[email protected]> | 2018-05-24 22:30:44 +1000 |
---|---|---|
committer | Ryan Dwyer <[email protected]> | 2018-06-01 23:14:58 +1000 |
commit | 1f2e399ade77070a2d0b82856ad9a3eef96b8676 (patch) | |
tree | c469197e140051aea912cb173723c7e55ce1e410 /sway/tree/workspace.c | |
parent | 1132efe42e8086216c7bab6b405d09a22231dde5 (diff) |
Implement floating
Diffstat (limited to 'sway/tree/workspace.c')
-rw-r--r-- | sway/tree/workspace.c | 17 |
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; +} |