render: resize with with/height == 0 resizes to user configured dimensions

This commit is contained in:
Daniel Eklöf 2020-02-25 20:29:44 +01:00
parent 2855d06c6e
commit ef53729242
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 6 additions and 23 deletions

View file

@ -1117,7 +1117,7 @@ render_search_box(struct terminal *term)
static bool
maybe_resize(struct terminal *term, int width, int height, bool force)
{
if (!force && (width == 0 || height == 0))
if (term->cell_width == 0 && term->cell_height == 0)
return false;
int scale = -1;
@ -1131,14 +1131,14 @@ maybe_resize(struct terminal *term, int width, int height, bool force)
scale = 1;
}
if (width == 0 && height == 0) {
width = term->conf->width;
height = term->conf->height;
}
width *= scale;
height *= scale;
if (!force && width == 0 && height == 0) {
/* Assume we're not fully up and running yet */
return false;
}
/* Scaled CSD border + title bar sizes */
const int csd_border = term->window->use_csd ? csd_border_size * scale : 0;
const int csd_title = term->window->use_csd ? csd_title_size * scale : 0;