aboutsummaryrefslogtreecommitdiff
path: root/sway/container.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/container.c')
-rw-r--r--sway/container.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sway/container.c b/sway/container.c
index ae70a8ee..bffbe620 100644
--- a/sway/container.c
+++ b/sway/container.c
@@ -878,7 +878,7 @@ void close_views(swayc_t *container) {
container_map(container, close_view, NULL);
}
-swayc_t *swayc_tabbed_stacked_parent(swayc_t *view) {
+swayc_t *swayc_tabbed_stacked_ancestor(swayc_t *view) {
swayc_t *parent = NULL;
if (!ASSERT_NONNULL(view)) {
return NULL;
@@ -892,3 +892,13 @@ swayc_t *swayc_tabbed_stacked_parent(swayc_t *view) {
return parent;
}
+
+swayc_t *swayc_tabbed_stacked_parent(swayc_t *con) {
+ if (!ASSERT_NONNULL(con)) {
+ return NULL;
+ }
+ if (con->parent && (con->parent->layout == L_TABBED || con->parent->layout == L_STACKED)) {
+ return con->parent;
+ }
+ return NULL;
+}