mirror of
https://github.com/swaywm/sway.git
synced 2024-11-26 18:01:29 +00:00
Fix recursion when counting descendants of a type
This commit is contained in:
parent
2adf23c2a3
commit
0f43eac5dc
|
@ -552,7 +552,8 @@ int container_count_descendants_of_type(struct sway_container *con,
|
||||||
int children = 0;
|
int children = 0;
|
||||||
if (con->type == type) {
|
if (con->type == type) {
|
||||||
children++;
|
children++;
|
||||||
} else if (con->children) {
|
}
|
||||||
|
if (con->children) {
|
||||||
for (int i = 0; i < con->children->length; i++) {
|
for (int i = 0; i < con->children->length; i++) {
|
||||||
struct sway_container *child = con->children->items[i];
|
struct sway_container *child = con->children->items[i];
|
||||||
children += container_count_descendants_of_type(child, type);
|
children += container_count_descendants_of_type(child, type);
|
||||||
|
|
Loading…
Reference in a new issue