1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-04-09 15:18:06 -05:00

GTK: fix font-size change when window maximised.

If you maximise the terminal window and then press Ctrl-> or Ctrl-< to
change the font size, then the maximised window can't change size, so
what _should_ happen instead is that the terminal adjusts the number
of character cells to whatever the new font size will now permit in
the same size of window as before.

But in fact, the terminal size wasn't changing at all, because the
call to gtkwin_request_resize (called from change_font_size) detected
the maximised window and went straight to gtkwin_deny_term_resize,
which immediately called term_size() to tell the terminal it still had
the same size as before.

This commit switches gtkwin_deny_term_resize so that instead it calls
drawing_area_setup_simple(), which re-runs drawing_area_setup with the
same size the drawing area already had. This should work out the same
in the case where we're _not_ changing the font size, but now also
does the right thing when we are.
This commit is contained in:
Simon Tatham 2022-02-03 17:48:21 +00:00
parent 397f3bd2b3
commit 1e98710174

View File

@ -2477,9 +2477,7 @@ static void compute_whole_window_size(GtkFrontend *inst,
static void gtkwin_deny_term_resize(void *vctx)
{
GtkFrontend *inst = (GtkFrontend *)vctx;
if (inst->term)
term_size(inst->term, inst->term->rows, inst->term->cols,
inst->term->savelines);
drawing_area_setup_simple(inst);
}
static void gtkwin_request_resize(TermWin *tw, int w, int h)