diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-09-11 19:19:17 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-11 19:19:17 -0400 |
commit | 4fbec701fcf1505d1c13d7f5d8b55264b8f07e4e (patch) | |
tree | 82daa71d644f15c2e1e58ca9bdb2d4e1a75d3be9 /sway/tree/workspace.c | |
parent | 822b45f4836c9a22af5a283e2aea6e4ecd514c22 (diff) | |
parent | 679c7eb08c16daea8e3e1cff7bcf179e116d0e8e (diff) |
Merge pull request #2618 from RyanDwyer/tiling-drag
Implement tiling drag
Diffstat (limited to 'sway/tree/workspace.c')
-rw-r--r-- | sway/tree/workspace.c | 15 |
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, } struct sway_container *workspace_wrap_children(struct sway_workspace *ws) { + struct sway_container *fs = ws->fullscreen; struct sway_container *middle = container_create(NULL); middle->layout = ws->layout; while (ws->tiling->length) { @@ -565,6 +566,7 @@ struct sway_container *workspace_wrap_children(struct sway_workspace *ws) { container_add_child(middle, child); } workspace_add_tiling(ws, middle); + ws->fullscreen = fs; return middle; } @@ -694,3 +696,16 @@ void workspace_get_box(struct sway_workspace *workspace, struct wlr_box *box) { box->width = workspace->width; box->height = workspace->height; } + +static void count_tiling_views(struct sway_container *con, void *data) { + if (con->view && !container_is_floating_or_child(con)) { + size_t *count = data; + *count += 1; + } +} + +size_t workspace_num_tiling_views(struct sway_workspace *ws) { + size_t count = 0; + workspace_for_each_container(ws, count_tiling_views, &count); + return count; +} |