mirror of
https://github.com/swaywm/sway.git
synced 2025-01-30 20:56:43 +00:00
fix hiding lone titlebar
This commit is contained in:
parent
94a2771e31
commit
cdf6f88a27
|
@ -288,14 +288,13 @@ static void arrange_container(struct sway_container *con,
|
||||||
|
|
||||||
static void arrange_children(enum sway_container_layout layout, list_t *children,
|
static void arrange_children(enum sway_container_layout layout, list_t *children,
|
||||||
struct sway_container *active, struct wlr_scene_tree *content,
|
struct sway_container *active, struct wlr_scene_tree *content,
|
||||||
int width, int height, int gaps) {
|
int width, int height, int gaps, bool parent_asks_for_title_bars) {
|
||||||
int title_bar_height = container_titlebar_height();
|
int title_bar_height = container_titlebar_height();
|
||||||
|
|
||||||
if (layout == L_TABBED) {
|
if (layout == L_TABBED) {
|
||||||
struct sway_container *first = children->length == 1 ?
|
bool show_titlebar = parent_asks_for_title_bars || !config->hide_lone_tab ||
|
||||||
((struct sway_container *)children->items[0]) : NULL;
|
(children->length > 1);
|
||||||
if (config->hide_lone_tab && first && first->view &&
|
if (!show_titlebar) {
|
||||||
first->current.border != B_NORMAL) {
|
|
||||||
title_bar_height = 0;
|
title_bar_height = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -322,10 +321,9 @@ static void arrange_children(enum sway_container_layout layout, list_t *children
|
||||||
title_offset = next_title_offset;
|
title_offset = next_title_offset;
|
||||||
}
|
}
|
||||||
} else if (layout == L_STACKED) {
|
} else if (layout == L_STACKED) {
|
||||||
struct sway_container *first = children->length == 1 ?
|
bool show_titlebar = parent_asks_for_title_bars || !config->hide_lone_tab ||
|
||||||
((struct sway_container *)children->items[0]) : NULL;
|
(children->length > 1);
|
||||||
if (config->hide_lone_tab && first && first->view &&
|
if (!show_titlebar) {
|
||||||
first->current.border != B_NORMAL) {
|
|
||||||
title_bar_height = 0;
|
title_bar_height = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -352,7 +350,8 @@ static void arrange_children(enum sway_container_layout layout, list_t *children
|
||||||
}
|
}
|
||||||
} else if (layout == L_VERT) {
|
} else if (layout == L_VERT) {
|
||||||
int off = 0;
|
int off = 0;
|
||||||
bool show_titlebar = !config->hide_lone_tab || (children->length > 1);
|
bool show_titlebar = parent_asks_for_title_bars || !config->hide_lone_tab ||
|
||||||
|
(children->length > 1);
|
||||||
for (int i = 0; i < children->length; i++) {
|
for (int i = 0; i < children->length; i++) {
|
||||||
struct sway_container *child = children->items[i];
|
struct sway_container *child = children->items[i];
|
||||||
int cheight = child->current.height;
|
int cheight = child->current.height;
|
||||||
|
@ -365,7 +364,8 @@ static void arrange_children(enum sway_container_layout layout, list_t *children
|
||||||
}
|
}
|
||||||
} else if (layout == L_HORIZ) {
|
} else if (layout == L_HORIZ) {
|
||||||
int off = 0;
|
int off = 0;
|
||||||
bool show_titlebar = !config->hide_lone_tab || (children->length > 1);
|
bool show_titlebar = parent_asks_for_title_bars || !config->hide_lone_tab ||
|
||||||
|
(children->length > 1);
|
||||||
for (int i = 0; i < children->length; i++) {
|
for (int i = 0; i < children->length; i++) {
|
||||||
struct sway_container *child = children->items[i];
|
struct sway_container *child = children->items[i];
|
||||||
int cwidth = child->current.width;
|
int cwidth = child->current.width;
|
||||||
|
@ -455,7 +455,7 @@ static void arrange_container(struct sway_container *con,
|
||||||
|
|
||||||
arrange_children(con->current.layout, con->current.children,
|
arrange_children(con->current.layout, con->current.children,
|
||||||
con->current.focused_inactive_child, con->content_tree,
|
con->current.focused_inactive_child, con->content_tree,
|
||||||
width, height, gaps);
|
width, height, gaps, title_bar);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -535,7 +535,7 @@ static void arrange_workspace_tiling(struct sway_workspace *ws,
|
||||||
int width, int height) {
|
int width, int height) {
|
||||||
arrange_children(ws->current.layout, ws->current.tiling,
|
arrange_children(ws->current.layout, ws->current.tiling,
|
||||||
ws->current.focused_inactive_child, ws->layers.tiling,
|
ws->current.focused_inactive_child, ws->layers.tiling,
|
||||||
width, height, ws->gaps_inner);
|
width, height, ws->gaps_inner, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void disable_workspace(struct sway_workspace *ws) {
|
static void disable_workspace(struct sway_workspace *ws) {
|
||||||
|
|
Loading…
Reference in a new issue