1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-25 01:02:24 +00:00

Fix window resizing in GTK 3 PuTTY.

In GTK 3, it was impossible to resize the window smaller than it
started off, because the size request on the drawing area was taken as
a minimum. (I can't actually remember how the GTK 2 version doesn't
have this problem too.)

Fixed by instead setting the initial window size using
gtk_window_set_default_geometry() (having first set up the geometry
hints to reflect the character cell size).
This commit is contained in:
Simon Tatham 2015-09-25 09:52:19 +01:00
parent 64ec5e03d5
commit 06cf210552

View File

@ -4836,6 +4836,12 @@ int pt_main(int argc, char **argv)
init_clipboard(inst);
set_geom_hints(inst);
#if GTK_CHECK_VERSION(3,0,0)
gtk_window_set_default_geometry(GTK_WINDOW(inst->window),
inst->width, inst->height);
#else
{
int w = inst->font_width * inst->width + 2*inst->window_border;
int h = inst->font_height * inst->height + 2*inst->window_border;
@ -4845,6 +4851,8 @@ int pt_main(int argc, char **argv)
gtk_drawing_area_size(GTK_DRAWING_AREA(inst->area), w, h);
#endif
}
#endif
inst->sbar_adjust = GTK_ADJUSTMENT(gtk_adjustment_new(0,0,0,0,0,0));
inst->sbar = gtk_vscrollbar_new(inst->sbar_adjust);
inst->hbox = GTK_BOX(gtk_hbox_new(FALSE, 0));
@ -4861,8 +4869,6 @@ int pt_main(int argc, char **argv)
gtk_container_add(GTK_CONTAINER(inst->window), GTK_WIDGET(inst->hbox));
set_geom_hints(inst);
gtk_widget_show(inst->area);
if (conf_get_int(inst->conf, CONF_scrollbar))
gtk_widget_show(inst->sbar);