fix title bar rendering with hide_edge_borders smart (#5260)
related to https://github.com/i3/i3/pull/5245 fixes https://github.com/i3/i3/issues/5254
This commit is contained in:
parent
e6a28b9475
commit
14795c303c
34
src/con.c
34
src/con.c
@ -1706,13 +1706,7 @@ bool con_draw_decoration_into_frame(Con *con) {
|
|||||||
con->parent->layout != L_STACKED));
|
con->parent->layout != L_STACKED));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
static Rect con_border_style_rect_without_title(Con *con) {
|
||||||
* Returns a "relative" Rect which contains the amount of pixels that need to
|
|
||||||
* be added to the original Rect to get the final position (obviously the
|
|
||||||
* amount of pixels for normal, 1pixel and borderless are different).
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
Rect con_border_style_rect(Con *con) {
|
|
||||||
if ((config.smart_borders == SMART_BORDERS_ON && con_num_visible_children(con_get_workspace(con)) <= 1) ||
|
if ((config.smart_borders == SMART_BORDERS_ON && con_num_visible_children(con_get_workspace(con)) <= 1) ||
|
||||||
(config.smart_borders == SMART_BORDERS_NO_GAPS && !has_outer_gaps(calculate_effective_gaps(con))) ||
|
(config.smart_borders == SMART_BORDERS_NO_GAPS && !has_outer_gaps(calculate_effective_gaps(con))) ||
|
||||||
(config.hide_edge_borders == HEBM_SMART && con_num_visible_children(con_get_workspace(con)) <= 1) ||
|
(config.hide_edge_borders == HEBM_SMART && con_num_visible_children(con_get_workspace(con)) <= 1) ||
|
||||||
@ -1738,16 +1732,7 @@ Rect con_border_style_rect(Con *con) {
|
|||||||
if (border_style == BS_NONE)
|
if (border_style == BS_NONE)
|
||||||
return (Rect){0, 0, 0, 0};
|
return (Rect){0, 0, 0, 0};
|
||||||
if (border_style == BS_NORMAL) {
|
if (border_style == BS_NORMAL) {
|
||||||
const int deco_height = render_deco_height();
|
|
||||||
result = (Rect){border_width, 0, -(2 * border_width), -(border_width)};
|
result = (Rect){border_width, 0, -(2 * border_width), -(border_width)};
|
||||||
if (con_draw_decoration_into_frame(con)) {
|
|
||||||
result = (Rect){
|
|
||||||
.x = border_width /* left */,
|
|
||||||
.y = deco_height,
|
|
||||||
.width = -(border_width /* left */ + border_width /* right */),
|
|
||||||
.height = -(border_width /* bottom */ + deco_height),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
result = (Rect){border_width, border_width, -(2 * border_width), -(2 * border_width)};
|
result = (Rect){border_width, border_width, -(2 * border_width), -(2 * border_width)};
|
||||||
}
|
}
|
||||||
@ -1776,6 +1761,23 @@ Rect con_border_style_rect(Con *con) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Returns a "relative" Rect which contains the amount of pixels that need to
|
||||||
|
* be added to the original Rect to get the final position (obviously the
|
||||||
|
* amount of pixels for normal, 1pixel and borderless are different).
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
Rect con_border_style_rect(Con *con) {
|
||||||
|
Rect result = con_border_style_rect_without_title(con);
|
||||||
|
if (con_border_style(con) == BS_NORMAL &&
|
||||||
|
con_draw_decoration_into_frame(con)) {
|
||||||
|
const int deco_height = render_deco_height();
|
||||||
|
result.y += deco_height;
|
||||||
|
result.height -= deco_height;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Returns adjacent borders of the window. We need this if hide_edge_borders is
|
* Returns adjacent borders of the window. We need this if hide_edge_borders is
|
||||||
* enabled.
|
* enabled.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user