aboutsummaryrefslogtreecommitdiff
path: root/sway/container.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2016-07-07 21:41:32 -0400
committerGitHub <noreply@github.com>2016-07-07 21:41:32 -0400
commit0374154749653b5f29b86e255af7b2346bddebe0 (patch)
tree20a270ed04829763c56c854f7b3978cf4b640e5d /sway/container.c
parent378149b59c8d2a6d2b0bab7f2bb507dbac990734 (diff)
parentee67cd0ba1e950f5e21328580cc46b618be5fc01 (diff)
Merge pull request #744 from thejan2009/tabbed-stacked-layout-fixes
Fix tabbed/stacked corner case #742
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) {
return swayc_is_parent_of(parent, child);
}
+bool swayc_is_empty_workspace(swayc_t *container) {
+ return container->type == C_WORKSPACE && container->children->length == 0;
+}
+
int swayc_gap(swayc_t *container) {
if (container->type == C_VIEW || container->type == C_CONTAINER) {
return container->gaps >= 0 ? container->gaps : config->gaps_inner;
@@ -879,7 +883,7 @@ swayc_t *swayc_tabbed_stacked_parent(swayc_t *view) {
if (!ASSERT_NONNULL(view)) {
return NULL;
}
- while (view->type != C_WORKSPACE && view->parent) {
+ while (view->type != C_WORKSPACE && view->parent && view->parent->type != C_WORKSPACE) {
view = view->parent;
if (view->layout == L_TABBED || view->layout == L_STACKED) {
parent = view;