aboutsummaryrefslogtreecommitdiff
path: root/render.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-09-09 17:00:30 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-09-09 17:00:30 +0000
commit99023cae99d97c6965de19ff38d2f0516153a37e (patch)
tree241a7714296d46ef9f9dc5e9f420b23850224504 /render.c
parentMerge branch 'keymap-shift-return' into master (diff)
parentAdd -W,--window-size-chars, and foot.ini:initial-window-size-chars (diff)
Merge branch 'window-size-in-characters' into master
Diffstat (limited to 'render.c')
-rw-r--r--render.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/render.c b/render.c
index 288ea8da..80f3bd90 100644
--- a/render.c
+++ b/render.c
@@ -2032,13 +2032,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;
- height = term->conf->height;
+ switch (term->conf->size.type) {
+ case CONF_SIZE_PX:
+ width = term->conf->size.px.width;
+ height = term->conf->size.px.height;
- if (term->window->use_csd == CSD_YES) {
- /* Take CSD title bar into account */
- assert(!term->window->is_fullscreen);
- height -= term->conf->csd.title_height;
+ if (term->window->use_csd == CSD_YES) {
+ /* Take CSD title bar into account */
+ assert(!term->window->is_fullscreen);
+ height -= term->conf->csd.title_height;
+ }
+ break;
+
+ case CONF_SIZE_CELLS:
+ width = 2 * term->conf->pad_x;
+ height = 2 * term->conf->pad_y;
+ width += term->conf->size.cells.width * term->cell_width;
+ height += term->conf->size.cells.height * term->cell_height;
+ break;
}
width *= scale;