aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/con.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/src/con.c b/src/con.c
index e7757309..e7e865ef 100644
--- a/src/con.c
+++ b/src/con.c
@@ -1706,13 +1706,7 @@ bool con_draw_decoration_into_frame(Con *con) {
con->parent->layout != L_STACKED));
}
-/*
- * 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) {
+static Rect con_border_style_rect_without_title(Con *con) {
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.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)
return (Rect){0, 0, 0, 0};
if (border_style == BS_NORMAL) {
- const int deco_height = render_deco_height();
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 {
result = (Rect){border_width, border_width, -(2 * border_width), -(2 * border_width)};
}
@@ -1777,6 +1762,23 @@ Rect con_border_style_rect(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) {
+ 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
* enabled.
*/