diff options
author | Ryan Dwyer <RyanDwyer@users.noreply.github.com> | 2018-05-13 11:52:51 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-13 11:52:51 +1000 |
commit | 0c96d757d0d5d1762390dd119cbe344e8781c19f (patch) | |
tree | 34ca494ccdc42799010a00f495b1d19193f20fe7 /sway/tree/container.c | |
parent | Merge pull request #1967 from emersion/remove-xdg-popup-unmap (diff) | |
parent | Merge branch 'master' into edge-borders (diff) | |
download | sway-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.c | 15 |
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 | ||
550 | int 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 | |||
550 | void container_damage_whole(struct sway_container *container) { | 565 | void 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]; |