diff options
Diffstat (limited to 'sway')
-rw-r--r-- | sway/desktop/render.c | 7 | ||||
-rw-r--r-- | sway/input/seat.c | 8 |
2 files changed, 13 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, struct border_colors *current_colors = &config->border_colors.unfocused; struct sway_container_state *pstate = &con->current; - int tab_width = pstate->swayc_width / pstate->children->length; + double width_gap_adjustment = 2 * pstate->current_gaps; + int tab_width = + (pstate->swayc_width - width_gap_adjustment) / pstate->children->length; // Render tabs for (int i = 0; i < pstate->children->length; ++i) { @@ -628,7 +630,8 @@ static void render_container_tabbed(struct sway_output *output, // Make last tab use the remaining width of the parent if (i == pstate->children->length - 1) { - tab_width = pstate->swayc_width - tab_width * i; + tab_width = + pstate->swayc_width - width_gap_adjustment - tab_width * i; } render_titlebar(output, damage, child, x, cstate->swayc_y, tab_width, diff --git a/sway/input/seat.c b/sway/input/seat.c index 5dadb31d..bf4e8876 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c @@ -666,6 +666,14 @@ void seat_set_focus_warp(struct sway_seat *seat, container_damage_whole(container->parent); } + // If we've focused a floating container, bring it to the front. + // We do this by putting it at the end of the floating list. + // This must happen for both the pending and current children lists. + if (container_is_floating(container)) { + list_move_to_end(container->parent->children, container); + list_move_to_end(container->parent->current.children, container); + } + // clean up unfocused empty workspace on new output if (new_output_last_ws) { if (!workspace_is_visible(new_output_last_ws) |