diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-05-24 22:30:44 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-06-01 23:14:58 +1000 |
commit | 1f2e399ade77070a2d0b82856ad9a3eef96b8676 (patch) | |
tree | c469197e140051aea912cb173723c7e55ce1e410 /sway/tree/workspace.c | |
parent | Send frame done to floating views (diff) | |
download | sway-1f2e399ade77070a2d0b82856ad9a3eef96b8676.tar.gz sway-1f2e399ade77070a2d0b82856ad9a3eef96b8676.tar.zst sway-1f2e399ade77070a2d0b82856ad9a3eef96b8676.zip |
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, | |||
65 | return NULL; | 65 | return NULL; |
66 | } | 66 | } |
67 | swayws->swayc = workspace; | 67 | swayws->swayc = workspace; |
68 | swayws->floating = create_list(); | 68 | swayws->floating = container_create(C_CONTAINER); |
69 | swayws->floating->parent = swayws->swayc; | ||
70 | swayws->floating->reapable = false; | ||
69 | workspace->sway_workspace = swayws; | 71 | workspace->sway_workspace = swayws; |
70 | 72 | ||
71 | container_add_child(output, workspace); | 73 | container_add_child(output, workspace); |
@@ -408,3 +410,16 @@ bool workspace_is_visible(struct sway_container *ws) { | |||
408 | } | 410 | } |
409 | return focus == ws; | 411 | return focus == ws; |
410 | } | 412 | } |
413 | |||
414 | bool workspace_is_empty(struct sway_container *ws) { | ||
415 | if (!sway_assert(ws->type == C_WORKSPACE, "Expected a workspace")) { | ||
416 | return false; | ||
417 | } | ||
418 | if (ws->children->length) { | ||
419 | return false; | ||
420 | } | ||
421 | if (ws->sway_workspace->floating->children->length) { | ||
422 | return false; | ||
423 | } | ||
424 | return true; | ||
425 | } | ||