From 9ee6a220e0d099ffe262b1696c5f60a641f14dda Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sat, 19 May 2018 07:38:22 +0100 Subject: [PATCH] GTK: reinstate accidentally removed calls to term_size. In commit 528513dde I absentmindedly replaced a write to the local variable 'need_size' of drawing_area_setup with a write to inst->drawing_area_setup_needed, imagining that they had the same effect. But actually, need_size was doing two jobs and I only replaced one of them: it was also the variable that indicated that the logical terminal size had changed and so we had to call term_size() to make the terminal.c data structures resize themselves appropriately. The loss of that call also inhibited generation of SIGWINCH. --- unix/gtkwin.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/unix/gtkwin.c b/unix/gtkwin.c index 0771b0b5..6638f0b3 100644 --- a/unix/gtkwin.c +++ b/unix/gtkwin.c @@ -636,16 +636,25 @@ static void drawing_area_setup(struct gui_data *inst, int width, int height) int w, h, new_scale, need_size = 0; /* - * See if the terminal size has changed, in which case we must - * let the terminal know. + * See if the terminal size has changed. */ w = (width - 2*inst->window_border) / inst->font_width; h = (height - 2*inst->window_border) / inst->font_height; if (w != inst->width || h != inst->height) { + /* + * Update conf. + */ inst->width = w; inst->height = h; conf_set_int(inst->conf, CONF_width, inst->width); conf_set_int(inst->conf, CONF_height, inst->height); + /* + * We'll need to tell terminal.c about the resize below. + */ + need_size = TRUE; + /* + * And we must refresh the window's backing image. + */ inst->drawing_area_setup_needed = TRUE; }