aboutsummaryrefslogtreecommitdiffstats
path: root/sway/container.c
diff options
context:
space:
mode:
authorLibravatar D.B <thejan.2009@gmail.com>2016-07-16 15:11:08 +0200
committerLibravatar D.B <thejan.2009@gmail.com>2016-07-16 15:34:43 +0200
commitad7605675ef5d1fc99653e80c3c846429abfda25 (patch)
tree001033de86cb34fca09837a643a0818f299cdf3e /sway/container.c
parentFix warning in window.c (diff)
downloadsway-ad7605675ef5d1fc99653e80c3c846429abfda25.tar.gz
sway-ad7605675ef5d1fc99653e80c3c846429abfda25.tar.zst
sway-ad7605675ef5d1fc99653e80c3c846429abfda25.zip
refactor swayc_tabbed_stacked_parent into _ancestor and _parent and use where needed
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) {
878 container_map(container, close_view, NULL); 878 container_map(container, close_view, NULL);
879} 879}
880 880
881swayc_t *swayc_tabbed_stacked_parent(swayc_t *view) { 881swayc_t *swayc_tabbed_stacked_ancestor(swayc_t *view) {
882 swayc_t *parent = NULL; 882 swayc_t *parent = NULL;
883 if (!ASSERT_NONNULL(view)) { 883 if (!ASSERT_NONNULL(view)) {
884 return NULL; 884 return NULL;
@@ -892,3 +892,13 @@ swayc_t *swayc_tabbed_stacked_parent(swayc_t *view) {
892 892
893 return parent; 893 return parent;
894} 894}
895
896swayc_t *swayc_tabbed_stacked_parent(swayc_t *con) {
897 if (!ASSERT_NONNULL(con)) {
898 return NULL;
899 }
900 if (con->parent && (con->parent->layout == L_TABBED || con->parent->layout == L_STACKED)) {
901 return con->parent;
902 }
903 return NULL;
904}