summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2016-10-12 12:19:02 -0400
committerFurkan Sahin <furkan-dev@proton.me>2016-10-12 12:19:02 -0400
commitb903ec75cd9de4d46cbf872a82697cd393497fee (patch)
tree13d40041fc41a2ba8d4f03ce403395334f8397d4
parent08ace5cfa2ccae6004dfcff6d17ddb8b9b76fd2b (diff)
Revert "also check floating cons in container_find"
-rw-r--r--sway/container.c25
1 files changed, 5 insertions, 20 deletions
diff --git a/sway/container.c b/sway/container.c
index c588f3db..c3461acb 100644
--- a/sway/container.c
+++ b/sway/container.c
@@ -729,29 +729,14 @@ 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) {
- con = container->children->items[i];
- if (f(con, data)) {
- return con;
+ if (f(container->children->items[i], data)) {
+ return container->children->items[i];
}
- con = container_find(con, f, data);
- if (con != NULL) {
- return con;
+ swayc_t *find = container_find(container->children->items[i], f, data);
+ if (find != NULL) {
+ return find;
}
}