From 18a3a999f6671763755b270713f7e43d6e0fa9fc Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Mon, 20 Dec 2021 10:18:38 +0000 Subject: [PATCH] GTK: fix calculation of fixed window size for SUPDUP. The window size set in the geometry hints when the backend has the BACKEND_RESIZE_FORBIDDEN flag was computed in a simplistic way that forgot to take account of window furniture like scrollbars and menu bars. Now it's computed based on the rest of the geometry hints, which are more accurate. --- unix/window.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unix/window.c b/unix/window.c index 4c57b020..f2edd356 100644 --- a/unix/window.c +++ b/unix/window.c @@ -4500,8 +4500,8 @@ void set_geom_hints(GtkFrontend *inst) 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.min_width = geom.base_width + geom.width_inc * inst->width; + geom.min_height = geom.base_height + geom.height_inc * inst->height; geom.max_width = geom.min_width; geom.max_height = geom.min_height; flags |= GDK_HINT_MAX_SIZE;