summaryrefslogtreecommitdiffstats
path: root/sway/tree/workspace.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/tree/workspace.c')
-rw-r--r--sway/tree/workspace.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sway/tree/workspace.c b/sway/tree/workspace.c
index b8e90892..18746430 100644
--- a/sway/tree/workspace.c
+++ b/sway/tree/workspace.c
@@ -557,6 +557,7 @@ struct sway_container *workspace_find_container(struct sway_workspace *ws,
557} 557}
558 558
559struct sway_container *workspace_wrap_children(struct sway_workspace *ws) { 559struct sway_container *workspace_wrap_children(struct sway_workspace *ws) {
560 struct sway_container *fs = ws->fullscreen;
560 struct sway_container *middle = container_create(NULL); 561 struct sway_container *middle = container_create(NULL);
561 middle->layout = ws->layout; 562 middle->layout = ws->layout;
562 while (ws->tiling->length) { 563 while (ws->tiling->length) {
@@ -565,6 +566,7 @@ struct sway_container *workspace_wrap_children(struct sway_workspace *ws) {
565 container_add_child(middle, child); 566 container_add_child(middle, child);
566 } 567 }
567 workspace_add_tiling(ws, middle); 568 workspace_add_tiling(ws, middle);
569 ws->fullscreen = fs;
568 return middle; 570 return middle;
569} 571}
570 572
@@ -694,3 +696,16 @@ void workspace_get_box(struct sway_workspace *workspace, struct wlr_box *box) {
694 box->width = workspace->width; 696 box->width = workspace->width;
695 box->height = workspace->height; 697 box->height = workspace->height;
696} 698}
699
700static void count_tiling_views(struct sway_container *con, void *data) {
701 if (con->view && !container_is_floating_or_child(con)) {
702 size_t *count = data;
703 *count += 1;
704 }
705}
706
707size_t workspace_num_tiling_views(struct sway_workspace *ws) {
708 size_t count = 0;
709 workspace_for_each_container(ws, count_tiling_views, &count);
710 return count;
711}