commit 24c3b8606555671cf31fe17db5d783846868a447
parent 6446e4409f1e6e106c1576683c858df785e3cf38
Author: D.B <thejan.2009@gmail.com>
Date: Mon, 10 Oct 2016 21:26:08 +0200
also check floating cons in container_find
Diffstat:
1 file changed, 20 insertions(+), 5 deletions(-)
diff --git a/sway/container.c b/sway/container.c
@@ -727,14 +727,29 @@ swayc_t *container_find(swayc_t *container, bool (*f)(swayc_t *, const void *),
return NULL;
}
+ swayc_t *con;
+ if (container->type == C_WORKSPACE) {
+ 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;
+ }
+ }
+ }
+
for (int i = 0; i < container->children->length; ++i) {
- if (f(container->children->items[i], data)) {
- return container->children->items[i];
+ con = container->children->items[i];
+ if (f(con, data)) {
+ return con;
}
- swayc_t *find = container_find(container->children->items[i], f, data);
- if (find != NULL) {
- return find;
+ con = container_find(con, f, data);
+ if (con != NULL) {
+ return con;
}
}