diff options
author | Drew DeVault <sir@cmpwn.com> | 2016-07-16 10:26:45 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-16 10:26:45 -0400 |
commit | d5ad8c9036f37576af94c6cbbe79e68415bb7e22 (patch) | |
tree | 001033de86cb34fca09837a643a0818f299cdf3e /sway/container.c | |
parent | 7aeedf0264e1745f2993a430a9cfef46a31e75ca (diff) | |
parent | ad7605675ef5d1fc99653e80c3c846429abfda25 (diff) |
Merge pull request #754 from thejan2009/containers-inside-tabbed-stacked
Clarify which tabbed/stacked container we want (fixes #751)
Diffstat (limited to 'sway/container.c')
-rw-r--r-- | sway/container.c | 12 |
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; +} |