diff options
author | Jasen Borisov <tajjada@gmail.com> | 2016-05-18 04:25:32 +0100 |
---|---|---|
committer | Jasen Borisov <tajjada@gmail.com> | 2016-05-18 04:25:32 +0100 |
commit | 870a7aaad998a566db2ef80648f44c14fef76c66 (patch) | |
tree | 37370af4463c0e7d62d4769e7f504db48ea11e16 | |
parent | Merge pull request #662 from Hummer12007/scroll (diff) | |
download | sway-870a7aaad998a566db2ef80648f44c14fef76c66.tar.gz sway-870a7aaad998a566db2ef80648f44c14fef76c66.tar.zst sway-870a7aaad998a566db2ef80648f44c14fef76c66.zip |
Fix issue #661.
Borders are now drawn correctly (same behavior as i3) for tabbed and
stacked containers, when the children have 'border none' set.
-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) { | |||
402 | void render_view_borders(wlc_handle view) { | 402 | void render_view_borders(wlc_handle view) { |
403 | swayc_t *c = swayc_by_handle(view); | 403 | swayc_t *c = swayc_by_handle(view); |
404 | 404 | ||
405 | if (!c || c->border_type == B_NONE) { | 405 | |
406 | // emulate i3 behavior for drawing borders for tabbed and stacked layouts: | ||
407 | // if we are not the only child in the container, always draw borders, | ||
408 | // regardless of the border setting on the individual view | ||
409 | if (!c || (c->border_type == B_NONE | ||
410 | && !((c->parent->layout == L_TABBED || c->parent->layout == L_STACKED) | ||
411 | && c->parent->children->length > 1))) { | ||
406 | return; | 412 | return; |
407 | } | 413 | } |
408 | 414 | ||
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) { | |||
594 | 594 | ||
595 | int title_bar_height = config->font_height + 4; //borders + padding | 595 | int title_bar_height = config->font_height + 4; //borders + padding |
596 | 596 | ||
597 | if (parent->layout == L_TABBED) { | 597 | if (parent->layout == L_TABBED && parent->children->length > 1) { |
598 | int i, x = 0, w, l, r; | 598 | int i, x = 0, w, l, r; |
599 | l = parent->children->length; | 599 | l = parent->children->length; |
600 | w = geometry.size.w / l; | 600 | w = geometry.size.w / l; |
@@ -625,7 +625,7 @@ void update_geometry(swayc_t *container) { | |||
625 | geometry.size.w -= (border_left + border_right); | 625 | geometry.size.w -= (border_left + border_right); |
626 | geometry.size.h -= (border_bottom + title_bar.size.h); | 626 | geometry.size.h -= (border_bottom + title_bar.size.h); |
627 | container->title_bar_geometry = title_bar; | 627 | container->title_bar_geometry = title_bar; |
628 | } else if (parent->layout == L_STACKED) { | 628 | } else if (parent->layout == L_STACKED && parent->children->length > 1) { |
629 | int i, y = 0; | 629 | int i, y = 0; |
630 | for (i = 0; i < parent->children->length; ++i) { | 630 | for (i = 0; i < parent->children->length; ++i) { |
631 | swayc_t *view = parent->children->items[i]; | 631 | swayc_t *view = parent->children->items[i]; |