diff options
| author | Furkan Sahin <furkan-dev@proton.me> | 2020-06-04 14:28:43 -0400 |
|---|---|---|
| committer | Furkan Sahin <furkan-dev@proton.me> | 2020-06-04 14:28:43 -0400 |
| commit | 71563094dd2f7a7a855e2fc489c9e4047b896f8c (patch) | |
| tree | 7532ea7ae132fcb592779b69606a54c6205dbbd9 /include | |
| parent | 6c8250605f6b259ac6ee2a1e6b24b6cfc536adb0 (diff) | |
tree/container: introduce `container_toplevel_ancestor` helper
This allows us to not have to explicitly write the same while loop
everywhere.
Diffstat (limited to 'include')
| -rw-r--r-- | include/sway/tree/container.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h index 8d2d8827..fd028131 100644 --- a/include/sway/tree/container.h +++ b/include/sway/tree/container.h @@ -273,6 +273,13 @@ void container_set_fullscreen(struct sway_container *con, void container_fullscreen_disable(struct sway_container *con); /** + * Walk up the container tree branch starting at the given container, and return + * its earliest ancestor. + */ +struct sway_container *container_toplevel_ancestor( + struct sway_container *container); + +/** * Return true if the container is floating, or a child of a floating split * container. */ |
