[gtk/matthiasc/surface-state-rework: 46/80] gtk/window: Use default size if non-resizable if set




commit 5f92a72315beb26b053cb0a2754ec825258f2029
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Wed Dec 2 16:44:25 2020 +0100

    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
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]