aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
authorRyan Dwyer <ryandwyer1@gmail.com>2018-07-16 12:45:20 +1000
committerRyan Dwyer <ryandwyer1@gmail.com>2018-07-16 12:45:20 +1000
commit560627437b536db490d7e4a3c6fb4282757a7327 (patch)
treeb7da1396542b391540995524c38507d96adb86aa /sway
parent64e3bc3ab09c0cc66b1675d39e4a9e872cbb46fd (diff)
Make container_for_each_descendant_dfs descend into floating views
Diffstat (limited to 'sway')
-rw-r--r--sway/tree/container.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index 35f67cce..99d57218 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -674,16 +674,23 @@ struct sway_container *floating_container_at(double lx, double ly,
void container_for_each_descendant_dfs(struct sway_container *container,
void (*f)(struct sway_container *container, void *data),
void *data) {
- if (container) {
- if (container->children) {
- for (int i = 0; i < container->children->length; ++i) {
- struct sway_container *child =
- container->children->items[i];
- container_for_each_descendant_dfs(child, f, data);
- }
+ if (!container) {
+ return;
+ }
+ if (container->children) {
+ for (int i = 0; i < container->children->length; ++i) {
+ struct sway_container *child = container->children->items[i];
+ container_for_each_descendant_dfs(child, f, data);
+ }
+ }
+ if (container->type == C_WORKSPACE) {
+ struct sway_container *floating = container->sway_workspace->floating;
+ for (int i = 0; i < floating->children->length; ++i) {
+ struct sway_container *child = floating->children->items[i];
+ container_for_each_descendant_dfs(child, f, data);
}
- f(container, data);
}
+ f(container, data);
}
void container_for_each_descendant_bfs(struct sway_container *con,