mirror of
https://github.com/swaywm/sway.git
synced 2025-11-04 13:29:52 -05:00
Arrange windows on desktop
This commit is contained in:
parent
289ba64bde
commit
ce1936bc65
8 changed files with 253 additions and 6 deletions
|
|
@ -108,3 +108,16 @@ swayc_t *new_view(swayc_t *sibling, struct sway_view *sway_view) {
|
|||
}
|
||||
return swayc;
|
||||
}
|
||||
|
||||
swayc_t *swayc_parent_by_type(swayc_t *container, enum swayc_types type) {
|
||||
if (!sway_assert(container, "container is NULL")) {
|
||||
return NULL;
|
||||
}
|
||||
if (!sway_assert(type < C_TYPES && type >= C_ROOT, "invalid type")) {
|
||||
return NULL;
|
||||
}
|
||||
do {
|
||||
container = container->parent;
|
||||
} while (container && container->type != type);
|
||||
return container;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue