1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-03 04:22:47 -05:00

New backend function to disable resizing.

Some protocols such as SUPDUP does not support resizing the terminal.
This commit is contained in:
Lars Brinkhoff
2020-02-14 13:49:56 +01:00
committed by Simon Tatham
parent 269bd7e309
commit e2b0e90c8c
5 changed files with 62 additions and 21 deletions

View File

@ -4445,6 +4445,7 @@ static void compute_geom_hints(GtkFrontend *inst, GdkGeometry *geom)
void set_geom_hints(GtkFrontend *inst)
{
const struct BackendVtable *vt;
GdkGeometry geom;
gint flags = GDK_HINT_MIN_SIZE | GDK_HINT_BASE_SIZE | GDK_HINT_RESIZE_INC;
compute_geom_hints(inst, &geom);
@ -4452,6 +4453,16 @@ void set_geom_hints(GtkFrontend *inst)
if (inst->gotpos)
flags |= GDK_HINT_USER_POS;
#endif
vt = backend_vt_from_proto(conf_get_int(inst->conf, CONF_protocol));
if (vt && vt->flags & BACKEND_RESIZE_FORBIDDEN) {
/* Window resizing forbidden. Set both minimum and maximum
* dimensions to be the initial size. */
geom.min_width = inst->width*inst->font_width + 2*inst->window_border;
geom.min_height = inst->height*inst->font_height + 2*inst->window_border;
geom.max_width = geom.min_width;
geom.max_height = geom.min_height;
flags |= GDK_HINT_MAX_SIZE;
}
gtk_window_set_geometry_hints(GTK_WINDOW(inst->window),
NULL, &geom, flags);
}