From e7e553ae5b49624bf38adc70e8e3a209d1ef2e5e Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Fri, 28 Feb 2020 18:50:15 +0100 Subject: render: resize: exclude CSD borders when loading default geometry in maximized mode --- render.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'render.c') diff --git a/render.c b/render.c index db824f17..53bedb75 100644 --- a/render.c +++ b/render.c @@ -1198,13 +1198,24 @@ maybe_resize(struct terminal *term, int width, int height, bool force) width = term->unmaximized_width; height = term->unmaximized_height; } else { - width = term->conf->width * scale; - height = term->conf->height * scale; + width = term->conf->width; + height = term->conf->height; + + if (term->window->use_csd == CSD_YES) { + assert(!term->window->is_fullscreen); + + /* Account for CSDs, to make actual window size match + * the configured size */ + if (!term->window->is_maximized) { + width -= 2 * csd_border_size; + height -= 2 * csd_border_size + csd_title_size; + } else { + height -= csd_title_size; + } + } -#if FOOT_CSD_OUTSIDE - width -= 2 * csd_border; - height -= 2 * csd_border + csd_title; -#endif + width *= scale; + height *= scale; } } -- cgit v1.3