From 5eca548accbeaa93567dc721dcbc8228ae74ab02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Wed, 2 Dec 2020 16:44:25 +0100 Subject: [PATCH] gtk/window: Use default size if non-resizable if set --- gtk/gtkwindow.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index b3f848f8e1..42f35da098 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -4277,12 +4277,22 @@ toplevel_compute_size (GdkToplevel *toplevel, } else if (!priv->resizable) { - width = nat_width; - height = nat_height; - - gtk_window_update_csd_size (window, - &width, &height, - INCLUDE_CSD_SIZE); + if (info && + info->default_width > 0 && + info->default_height > 0) + { + width = info->default_width; + height = info->default_height; + gtk_window_update_csd_size (window, &width, &height, + INCLUDE_CSD_SIZE); + } + else + { + width = nat_width; + height = nat_height; + gtk_window_update_csd_size (window, &width, &height, + INCLUDE_CSD_SIZE); + } } else {