aboutsummaryrefslogtreecommitdiff
path: root/src/con.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/con.c')
-rw-r--r--src/con.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/con.c b/src/con.c
index 47f75167..5bf559a1 100644
--- a/src/con.c
+++ b/src/con.c
@@ -2579,3 +2579,18 @@ void con_merge_into(Con *old, Con *new) {
tree_close_internal(old, DONT_KILL_WINDOW, false);
}
+
+/*
+ * Returns true if the container is within any stacked/tabbed split container.
+ *
+ */
+bool con_inside_stacked_or_tabbed(Con *con) {
+ if (con->parent == NULL) {
+ return false;
+ }
+ if (con->parent->layout == L_STACKED ||
+ con->parent->layout == L_TABBED) {
+ return true;
+ }
+ return con_inside_stacked_or_tabbed(con->parent);
+}