mirror of
https://github.com/swaywm/sway.git
synced 2025-11-08 13:29:50 -05:00
Basic workspace functionality
This commit is contained in:
parent
caee41b777
commit
8cc2c6fa7a
6 changed files with 128 additions and 1 deletions
18
sway/container.c
Normal file
18
sway/container.c
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#include "container.h"
|
||||
#include "layout.h"
|
||||
|
||||
void container_map(swayc_t *container, void (*f)(swayc_t *view, void *data), void *data) {
|
||||
if (!container->children) {
|
||||
return NULL;
|
||||
}
|
||||
int i;
|
||||
for (i = 0; i < container->children->length; ++i) {
|
||||
swayc_t *child = container->children->items[i];
|
||||
f(child, data);
|
||||
|
||||
if(child->children)
|
||||
container_map(child, f, data);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue