Skip to content

Commit

Permalink
fix hiding lone titlebar
Browse files Browse the repository at this point in the history
  • Loading branch information
svalaskevicius committed Mar 21, 2024
1 parent 72d32e2 commit 80e3105
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sway/desktop/transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,26 +351,28 @@ static void arrange_children(enum sway_container_layout layout, list_t *children
}
} else if (layout == L_VERT) {
int off = 0;
bool show_titlebar = !config->hide_lone_tab || (children->length > 1);
for (int i = 0; i < children->length; i++) {
struct sway_container *child = children->items[i];
int cheight = child->current.height;

wlr_scene_node_set_enabled(&child->border.tree->node, true);
wlr_scene_node_set_position(&child->scene_tree->node, 0, off);
wlr_scene_node_reparent(&child->scene_tree->node, content);
arrange_container(child, width, cheight, true, gaps);
arrange_container(child, width, cheight, show_titlebar, gaps);
off += cheight + gaps;
}
} else if (layout == L_HORIZ) {
int off = 0;
bool show_titlebar = !config->hide_lone_tab || (children->length > 1);
for (int i = 0; i < children->length; i++) {
struct sway_container *child = children->items[i];
int cwidth = child->current.width;

wlr_scene_node_set_enabled(&child->border.tree->node, true);
wlr_scene_node_set_position(&child->scene_tree->node, off, 0);
wlr_scene_node_reparent(&child->scene_tree->node, content);
arrange_container(child, cwidth, height, true, gaps);
arrange_container(child, cwidth, height, show_titlebar, gaps);
off += cwidth + gaps;
}
} else {
Expand Down

0 comments on commit 80e3105

Please sign in to comment.