diff options
| author | Furkan Sahin <furkan-dev@proton.me> | 2018-05-12 21:19:55 -0400 |
|---|---|---|
| committer | Furkan Sahin <furkan-dev@proton.me> | 2018-05-12 21:19:55 -0400 |
| commit | 70d7829df0e9bf5add58d37737f6fda2409f562f (patch) | |
| tree | 6dcca5c8e790ca66f0dc696608f693abca23da70 | |
| parent | 478b5bda446cbcf774d52274f9a5e7c0e55f2e82 (diff) | |
Fix recursion when counting descendants of a type
| -rw-r--r-- | sway/tree/container.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c index c26afdd8..fc35a81c 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c @@ -552,7 +552,8 @@ int container_count_descendants_of_type(struct sway_container *con, int children = 0; if (con->type == type) { children++; - } else if (con->children) { + } + if (con->children) { for (int i = 0; i < con->children->length; i++) { struct sway_container *child = con->children->items[i]; children += container_count_descendants_of_type(child, type); |
