[gtk/present-toplevel-2: 3/59] update to new toplevellayout api



commit 7a3bc65e3ebd0053dd34f13b99ddfd5292127ed7
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Mar 5 09:42:05 2020 -0800

    update to new toplevellayout api

 gdk/gdksurface.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)
---
diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c
index 843ebc3b3a..365f90f937 100644
--- a/gdk/gdksurface.c
+++ b/gdk/gdksurface.c
@@ -2095,14 +2095,22 @@ gdk_toplevel_surface_present (GdkToplevel       *toplevel,
   g_return_val_if_fail (surface->surface_type == GDK_SURFACE_TOPLEVEL, FALSE);
   g_return_val_if_fail (!GDK_SURFACE_DESTROYED (surface), FALSE);
 
-  gdk_toplevel_layout_get_min_size (layout,
-                                    &geometry.min_width,
-                                    &geometry.min_height);
-  gdk_toplevel_layout_get_max_size (layout,
-                                    &geometry.max_width,
-                                    &geometry.max_height);
-  mask = GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE;
-  gdk_surface_set_geometry_hints (surface, &geometry, mask); 
+  GDK_SURFACE_GET_CLASS (surface)->unminimize (surface);
+
+  if (gdk_toplevel_layout_get_resizable (layout))
+    {
+      geometry.min_width = gdk_toplevel_layout_get_min_width (layout);
+      geometry.min_height = gdk_toplevel_layout_get_min_height (layout);
+      mask = GDK_HINT_MIN_SIZE;
+    }
+  else
+    {
+      geometry.max_width = geometry.min_width = width;
+      geometry.max_height = geometry.min_height = height;
+      mask = GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE;
+    }
+
+  GDK_SURFACE_GET_CLASS (surface)->set_geometry_hints (surface, &geometry, mask);
   gdk_surface_constrain_size (&geometry, mask, width, height, &width, &height);
   GDK_SURFACE_GET_CLASS (surface)->toplevel_resize (surface, width, height);
 


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