[gtk/fix-3728-3799: 6/8] gdksurface-win32.c: Fix maximize




commit e1e6e7aeb6af8707b9268fbd51da2204ee035b05
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Fri Jul 2 11:19:49 2021 +0800

    gdksurface-win32.c: Fix maximize
    
    We need to stop requesting for configuring when we are maximizing the
    toplevel surface, otherwise maximizing breaks due to the previous
    updates.

 gdk/win32/gdksurface-win32.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/gdk/win32/gdksurface-win32.c b/gdk/win32/gdksurface-win32.c
index e9da5f6701..62794881df 100644
--- a/gdk/win32/gdksurface-win32.c
+++ b/gdk/win32/gdksurface-win32.c
@@ -4593,15 +4593,21 @@ _gdk_win32_surface_request_layout (GdkSurface *surface)
 
       if (GDK_IS_TOPLEVEL (surface))
         {
+          gboolean maximize = FALSE;
+
           surface->x = rect.left / scale;
           surface->y = rect.top / scale;
 
           /*
            * We force a resize of the toplevel if it is not just created/
            * presented and it did not just undergo an AeroSnap op and it
-           * was not minimized.
+           * was not minimized nor minimized.
            */
-          if (impl->toplevel_force_resize)
+          if (impl->toplevel_layout != NULL)
+            gdk_toplevel_layout_get_maximized (impl->toplevel_layout,
+                                              &maximize);
+
+          if (impl->toplevel_force_resize && !maximize)
             impl->drag_move_resize_context.native_move_resize_pending = TRUE;
         }
       else if (GDK_IS_POPUP (surface))
@@ -4980,6 +4986,7 @@ gdk_win32_toplevel_present (GdkToplevel       *toplevel,
 
   gdk_win32_surface_show (surface, FALSE);
   maybe_notify_mapped (surface);
+
   impl->toplevel_force_resize = TRUE;
 }
 


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