[gtk/wip/chergert/macos-fix-toplevel-resize] macos: fix window resize after display




commit ac30f189f550cfbcb00512c99c946d74e203bf9a
Author: Christian Hergert <christian hergert me>
Date:   Tue Feb 15 09:45:08 2022 -0800

    macos: fix window resize after display
    
    If the window default size is changed after display we should be
    recomputing size based on that. This also fixes the animated-resizing test.

 gdk/macos/gdkmacostoplevelsurface.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
---
diff --git a/gdk/macos/gdkmacostoplevelsurface.c b/gdk/macos/gdkmacostoplevelsurface.c
index 17b1cec708..246dbe0cca 100644
--- a/gdk/macos/gdkmacostoplevelsurface.c
+++ b/gdk/macos/gdkmacostoplevelsurface.c
@@ -419,9 +419,6 @@ _gdk_macos_toplevel_surface_compute_size (GdkSurface *surface)
   g_warn_if_fail (size.width > 0);
   g_warn_if_fail (size.height > 0);
 
-  width = surface->width;
-  height = surface->height;
-
   if (self->layout != NULL &&
       gdk_toplevel_layout_get_resizable (self->layout))
     {
@@ -443,7 +440,7 @@ _gdk_macos_toplevel_surface_compute_size (GdkSurface *surface)
                                    size.shadow.bottom,
                                    size.shadow.left);
 
-  gdk_surface_constrain_size (&geometry, mask, width, height, &width, &height);
+  gdk_surface_constrain_size (&geometry, mask, size.width, size.height, &width, &height);
 
   _gdk_macos_surface_set_geometry_hints (GDK_MACOS_SURFACE (self), &geometry, mask);
   _gdk_macos_surface_resize (GDK_MACOS_SURFACE (self), width, height);


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