diff options
author | emersion <contact@emersion.fr> | 2018-07-11 08:56:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-11 08:56:30 +0100 |
commit | 0f14abf5120db02ee80df4cc931e2abcd05af396 (patch) | |
tree | e1e3e13fde06961fe1095856cf3c1e2457570c5d | |
parent | Merge pull request #2233 from emersion/remove-clipboard (diff) | |
parent | removed unnecessary parens (diff) | |
download | sway-0f14abf5120db02ee80df4cc931e2abcd05af396.tar.gz sway-0f14abf5120db02ee80df4cc931e2abcd05af396.tar.zst sway-0f14abf5120db02ee80df4cc931e2abcd05af396.zip |
Merge pull request #2241 from rustysec/master
fix tabbed titlebar widths
-rw-r--r-- | sway/desktop/render.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sway/desktop/render.c b/sway/desktop/render.c index f554b813..28c81942 100644 --- a/sway/desktop/render.c +++ b/sway/desktop/render.c | |||
@@ -599,7 +599,9 @@ static void render_container_tabbed(struct sway_output *output, | |||
599 | struct border_colors *current_colors = &config->border_colors.unfocused; | 599 | struct border_colors *current_colors = &config->border_colors.unfocused; |
600 | struct sway_container_state *pstate = &con->current; | 600 | struct sway_container_state *pstate = &con->current; |
601 | 601 | ||
602 | int tab_width = pstate->swayc_width / pstate->children->length; | 602 | double width_gap_adjustment = 2 * pstate->current_gaps; |
603 | int tab_width = | ||
604 | (pstate->swayc_width - width_gap_adjustment) / pstate->children->length; | ||
603 | 605 | ||
604 | // Render tabs | 606 | // Render tabs |
605 | for (int i = 0; i < pstate->children->length; ++i) { | 607 | for (int i = 0; i < pstate->children->length; ++i) { |
@@ -628,7 +630,8 @@ static void render_container_tabbed(struct sway_output *output, | |||
628 | 630 | ||
629 | // Make last tab use the remaining width of the parent | 631 | // Make last tab use the remaining width of the parent |
630 | if (i == pstate->children->length - 1) { | 632 | if (i == pstate->children->length - 1) { |
631 | tab_width = pstate->swayc_width - tab_width * i; | 633 | tab_width = |
634 | pstate->swayc_width - width_gap_adjustment - tab_width * i; | ||
632 | } | 635 | } |
633 | 636 | ||
634 | render_titlebar(output, damage, child, x, cstate->swayc_y, tab_width, | 637 | render_titlebar(output, damage, child, x, cstate->swayc_y, tab_width, |