mirror of
https://github.com/swaywm/sway.git
synced 2025-03-31 09:27:46 +03:00
Fix tabbed/stacking container height regression
Commit c2d6aff
added a bounds check on `height - title_bar_height`,
repurposing the local variable `height` in an attempt to DRY out the
expression.
However, because re-assignment occurs inside the loop body, its result
would leak across loop iterations, compounding its effect and leading
to the artifact reported in issue #8625, where each child except the
first in a tabbed container would acquire a visible waterline.
Introduce a second variable and reset it in each loop iteration to get
rid of the waterline.
Fixes #8625.
This commit is contained in:
parent
ab455bbada
commit
a25645a5a6
1 changed files with 6 additions and 6 deletions
|
@ -312,9 +312,9 @@ static void arrange_children(enum sway_container_layout layout, list_t *children
|
|||
wlr_scene_node_set_position(&child->scene_tree->node, 0, title_bar_height);
|
||||
wlr_scene_node_reparent(&child->scene_tree->node, content);
|
||||
|
||||
height -= title_bar_height;
|
||||
if (activated && width > 0 && height > 0) {
|
||||
arrange_container(child, width, height, title_bar_height == 0, 0);
|
||||
int net_height = height - title_bar_height;
|
||||
if (activated && width > 0 && net_height > 0) {
|
||||
arrange_container(child, width, net_height, title_bar_height == 0, 0);
|
||||
} else {
|
||||
disable_container(child);
|
||||
}
|
||||
|
@ -341,9 +341,9 @@ static void arrange_children(enum sway_container_layout layout, list_t *children
|
|||
wlr_scene_node_set_position(&child->scene_tree->node, 0, title_height);
|
||||
wlr_scene_node_reparent(&child->scene_tree->node, content);
|
||||
|
||||
height -= title_bar_height;
|
||||
if (activated && width > 0 && height > 0) {
|
||||
arrange_container(child, width, height, title_bar_height == 0, 0);
|
||||
int net_height = height - title_bar_height;
|
||||
if (activated && width > 0 && net_height > 0) {
|
||||
arrange_container(child, width, net_height, title_bar_height == 0, 0);
|
||||
} else {
|
||||
disable_container(child);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue