summaryrefslogtreecommitdiff
path: root/sway/tree/workspace.c
diff options
context:
space:
mode:
authorRyan Dwyer <[email protected]>2018-09-11 21:34:21 +1000
committerRyan Dwyer <[email protected]>2018-09-11 21:34:21 +1000
commit8bb40c24c7b045df0d43e9f22c096d1473f6f9f6 (patch)
tree0c4dbac1173f92337e2cff63d45c7d8fe7a3557f /sway/tree/workspace.c
parentec9c4de564286d3795dd204e2c0a69b10f7572be (diff)
Implement tiling drag
Hold floating_modifier and drag a tiling view to a new location.
Diffstat (limited to 'sway/tree/workspace.c')
-rw-r--r--sway/tree/workspace.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/sway/tree/workspace.c b/sway/tree/workspace.c
index b8e90892..d4b57a0f 100644
--- a/sway/tree/workspace.c
+++ b/sway/tree/workspace.c
@@ -694,3 +694,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;
+}