diff options
Diffstat (limited to 'sway/tree/container.c')
-rw-r--r-- | sway/tree/container.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c index 67fac5ee..ebf9f98e 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c | |||
@@ -381,13 +381,13 @@ void container_map(swayc_t *container, void (*f)(swayc_t *view, void *data), voi | |||
381 | } | 381 | } |
382 | } | 382 | } |
383 | 383 | ||
384 | /** | 384 | void container_for_each_bfs(swayc_t *con, void (*f)(swayc_t *con, void *data), |
385 | * Get a list of containers that are descendents of the container in rendering | 385 | void *data) { |
386 | * order | ||
387 | */ | ||
388 | list_t *container_list_children(swayc_t *con) { | ||
389 | list_t *list = create_list(); | ||
390 | list_t *queue = create_list(); | 386 | list_t *queue = create_list(); |
387 | if (queue == NULL) { | ||
388 | wlr_log(L_ERROR, "could not allocate list"); | ||
389 | return; | ||
390 | } | ||
391 | 391 | ||
392 | list_add(queue, con); | 392 | list_add(queue, con); |
393 | 393 | ||
@@ -395,11 +395,10 @@ list_t *container_list_children(swayc_t *con) { | |||
395 | while (queue->length) { | 395 | while (queue->length) { |
396 | current = queue->items[0]; | 396 | current = queue->items[0]; |
397 | list_del(queue, 0); | 397 | list_del(queue, 0); |
398 | list_add(list, current); | 398 | f(current, data); |
399 | // TODO floating containers | 399 | // TODO floating containers |
400 | list_cat(queue, current->children); | 400 | list_cat(queue, current->children); |
401 | } | 401 | } |
402 | 402 | ||
403 | list_free(queue); | 403 | list_free(queue); |
404 | return list; | ||
405 | } | 404 | } |