mirror of
https://github.com/swaywm/sway.git
synced 2024-12-30 17:06:40 +01:00
Make container_for_each_descendant_dfs descend into floating views
This commit is contained in:
parent
64e3bc3ab0
commit
560627437b
1 changed files with 16 additions and 9 deletions
|
@ -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 container_for_each_descendant_dfs(struct sway_container *container,
|
||||||
void (*f)(struct sway_container *container, void *data),
|
void (*f)(struct sway_container *container, void *data),
|
||||||
void *data) {
|
void *data) {
|
||||||
if (container) {
|
if (!container) {
|
||||||
if (container->children) {
|
return;
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
f(container, data);
|
|
||||||
}
|
}
|
||||||
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
void container_for_each_descendant_bfs(struct sway_container *con,
|
void container_for_each_descendant_bfs(struct sway_container *con,
|
||||||
|
|
Loading…
Reference in a new issue