also check floating cons in container_find
This commit is contained in:
parent
6446e4409f
commit
24c3b86065
|
@ -727,14 +727,29 @@ swayc_t *container_find(swayc_t *container, bool (*f)(swayc_t *, const void *),
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < container->children->length; ++i) {
|
swayc_t *con;
|
||||||
if (f(container->children->items[i], data)) {
|
if (container->type == C_WORKSPACE) {
|
||||||
return container->children->items[i];
|
for (int i = 0; i < container->floating->length; ++i) {
|
||||||
|
con = container->floating->items[i];
|
||||||
|
if (f(con, data)) {
|
||||||
|
return con;
|
||||||
|
}
|
||||||
|
con = container_find(con, f, data);
|
||||||
|
if (con != NULL) {
|
||||||
|
return con;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
swayc_t *find = container_find(container->children->items[i], f, data);
|
for (int i = 0; i < container->children->length; ++i) {
|
||||||
if (find != NULL) {
|
con = container->children->items[i];
|
||||||
return find;
|
if (f(con, data)) {
|
||||||
|
return con;
|
||||||
|
}
|
||||||
|
|
||||||
|
con = container_find(con, f, data);
|
||||||
|
if (con != NULL) {
|
||||||
|
return con;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue