diff options
author | Drew DeVault <sir@cmpwn.com> | 2016-05-18 00:31:54 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2016-05-18 00:31:54 -0400 |
commit | ae52511649539fb85d3a9de191c1260f0ef9d571 (patch) | |
tree | 37370af4463c0e7d62d4769e7f504db48ea11e16 /sway | |
parent | ae027aad5a4a1c83cb4dd073aaeb2276b2e659ac (diff) | |
parent | 870a7aaad998a566db2ef80648f44c14fef76c66 (diff) |
Merge pull request #666 from tajjada/fix-tabbed-stacked-borders
Fix borders for tabbed and stacked containers when children have 'border none' set.
Diffstat (limited to 'sway')
-rw-r--r-- | sway/border.c | 8 | ||||
-rw-r--r-- | sway/layout.c | 4 |
2 files changed, 9 insertions, 3 deletions
diff --git a/sway/border.c b/sway/border.c index 0d1be970..7600351a 100644 --- a/sway/border.c +++ b/sway/border.c @@ -402,7 +402,13 @@ void update_view_border(swayc_t *view) { void render_view_borders(wlc_handle view) { swayc_t *c = swayc_by_handle(view); - if (!c || c->border_type == B_NONE) { + + // emulate i3 behavior for drawing borders for tabbed and stacked layouts: + // if we are not the only child in the container, always draw borders, + // regardless of the border setting on the individual view + if (!c || (c->border_type == B_NONE + && !((c->parent->layout == L_TABBED || c->parent->layout == L_STACKED) + && c->parent->children->length > 1))) { return; } diff --git a/sway/layout.c b/sway/layout.c index e2e58a77..8bf4ce00 100644 --- a/sway/layout.c +++ b/sway/layout.c @@ -594,7 +594,7 @@ void update_geometry(swayc_t *container) { int title_bar_height = config->font_height + 4; //borders + padding - if (parent->layout == L_TABBED) { + if (parent->layout == L_TABBED && parent->children->length > 1) { int i, x = 0, w, l, r; l = parent->children->length; w = geometry.size.w / l; @@ -625,7 +625,7 @@ void update_geometry(swayc_t *container) { geometry.size.w -= (border_left + border_right); geometry.size.h -= (border_bottom + title_bar.size.h); container->title_bar_geometry = title_bar; - } else if (parent->layout == L_STACKED) { + } else if (parent->layout == L_STACKED && parent->children->length > 1) { int i, y = 0; for (i = 0; i < parent->children->length; ++i) { swayc_t *view = parent->children->items[i]; |