aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/container.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <RyanDwyer@users.noreply.github.com>2018-05-13 11:52:51 +1000
committerLibravatar GitHub <noreply@github.com>2018-05-13 11:52:51 +1000
commit0c96d757d0d5d1762390dd119cbe344e8781c19f (patch)
tree34ca494ccdc42799010a00f495b1d19193f20fe7 /sway/tree/container.c
parentMerge pull request #1967 from emersion/remove-xdg-popup-unmap (diff)
parentMerge branch 'master' into edge-borders (diff)
downloadsway-0c96d757d0d5d1762390dd119cbe344e8781c19f.tar.gz
sway-0c96d757d0d5d1762390dd119cbe344e8781c19f.tar.zst
sway-0c96d757d0d5d1762390dd119cbe344e8781c19f.zip
Merge pull request #1960 from RedSoxFan/edge-borders
Implement hide_edge_borders
Diffstat (limited to 'sway/tree/container.c')
-rw-r--r--sway/tree/container.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index db02c69c..fc35a81c 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -547,6 +547,21 @@ bool container_has_child(struct sway_container *con,
547 return container_find(con, find_child_func, child); 547 return container_find(con, find_child_func, child);
548} 548}
549 549
550int container_count_descendants_of_type(struct sway_container *con,
551 enum sway_container_type type) {
552 int children = 0;
553 if (con->type == type) {
554 children++;
555 }
556 if (con->children) {
557 for (int i = 0; i < con->children->length; i++) {
558 struct sway_container *child = con->children->items[i];
559 children += container_count_descendants_of_type(child, type);
560 }
561 }
562 return children;
563}
564
550void container_damage_whole(struct sway_container *container) { 565void container_damage_whole(struct sway_container *container) {
551 for (int i = 0; i < root_container.children->length; ++i) { 566 for (int i = 0; i < root_container.children->length; ++i) {
552 struct sway_container *cont = root_container.children->items[i]; 567 struct sway_container *cont = root_container.children->items[i];