summaryrefslogtreecommitdiffstats
path: root/sway/container.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/container.c')
-rw-r--r--sway/container.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sway/container.c b/sway/container.c
index a7e46571..ae70a8ee 100644
--- a/sway/container.c
+++ b/sway/container.c
@@ -740,6 +740,10 @@ bool swayc_is_child_of(swayc_t *child, swayc_t *parent) {
740 return swayc_is_parent_of(parent, child); 740 return swayc_is_parent_of(parent, child);
741} 741}
742 742
743bool swayc_is_empty_workspace(swayc_t *container) {
744 return container->type == C_WORKSPACE && container->children->length == 0;
745}
746
743int swayc_gap(swayc_t *container) { 747int swayc_gap(swayc_t *container) {
744 if (container->type == C_VIEW || container->type == C_CONTAINER) { 748 if (container->type == C_VIEW || container->type == C_CONTAINER) {
745 return container->gaps >= 0 ? container->gaps : config->gaps_inner; 749 return container->gaps >= 0 ? container->gaps : config->gaps_inner;
@@ -879,7 +883,7 @@ swayc_t *swayc_tabbed_stacked_parent(swayc_t *view) {
879 if (!ASSERT_NONNULL(view)) { 883 if (!ASSERT_NONNULL(view)) {
880 return NULL; 884 return NULL;
881 } 885 }
882 while (view->type != C_WORKSPACE && view->parent) { 886 while (view->type != C_WORKSPACE && view->parent && view->parent->type != C_WORKSPACE) {
883 view = view->parent; 887 view = view->parent;
884 if (view->layout == L_TABBED || view->layout == L_STACKED) { 888 if (view->layout == L_TABBED || view->layout == L_STACKED) {
885 parent = view; 889 parent = view;