mirror of
https://github.com/swaywm/sway.git
synced 2025-11-05 13:29:51 -05:00
basic command criteria
This commit is contained in:
parent
c353e01c85
commit
6a1d71b8b8
8 changed files with 549 additions and 9 deletions
|
|
@ -321,3 +321,25 @@ swayc_t *swayc_at(swayc_t *parent, double lx, double ly,
|
|||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void container_map(swayc_t *container, void (*f)(swayc_t *view, void *data), void *data) {
|
||||
if (container) {
|
||||
int i;
|
||||
if (container->children) {
|
||||
for (i = 0; i < container->children->length; ++i) {
|
||||
swayc_t *child = container->children->items[i];
|
||||
container_map(child, f, data);
|
||||
}
|
||||
}
|
||||
// TODO
|
||||
/*
|
||||
if (container->floating) {
|
||||
for (i = 0; i < container->floating->length; ++i) {
|
||||
swayc_t *child = container->floating->items[i];
|
||||
container_map(child, f, data);
|
||||
}
|
||||
}
|
||||
*/
|
||||
f(container, data);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue