diff options
Diffstat (limited to 'sway/tree/workspace.c')
-rw-r--r-- | sway/tree/workspace.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sway/tree/workspace.c b/sway/tree/workspace.c index 3bcba8e5..476c2568 100644 --- a/sway/tree/workspace.c +++ b/sway/tree/workspace.c @@ -817,3 +817,16 @@ size_t workspace_num_tiling_views(struct sway_workspace *ws) { workspace_for_each_container(ws, count_tiling_views, &count); return count; } + +static void count_sticky_containers(struct sway_container *con, void *data) { + if (container_is_floating(con) && con->is_sticky) { + size_t *count = data; + *count += 1; + } +} + +size_t workspace_num_sticky_containers(struct sway_workspace *ws) { + size_t count = 0; + workspace_for_each_container(ws, count_sticky_containers, &count); + return count; +} |