Parcourir la source

Don't send resize message on minimize.

Fixes #571.
Steven Kirk il y a 9 ans
Parent
commit
ca305adea0

+ 9 - 0
src/Windows/Avalonia.Win32/Interop/UnmanagedMethods.cs

@@ -75,6 +75,15 @@ namespace Avalonia.Win32.Interop
             SWP_RESIZE = SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER
         }
 
+        public enum SizeCommand
+        {
+            Restored,
+            Minimized,
+            Maximized,
+            MaxShow,
+            MaxHide,
+        }
+
         public enum ShowWindowCommand
         {
             Hide = 0,

+ 3 - 1
src/Windows/Avalonia.Win32/WindowImpl.cs

@@ -552,7 +552,9 @@ namespace Avalonia.Win32
                     return IntPtr.Zero;
 
                 case UnmanagedMethods.WindowsMessage.WM_SIZE:
-                    if (Resized != null)
+                    if (Resized != null &&
+                        (wParam == (IntPtr)UnmanagedMethods.SizeCommand.Restored ||
+                         wParam == (IntPtr)UnmanagedMethods.SizeCommand.Maximized))
                     {
                         var clientSize = new Size((int)lParam & 0xffff, (int)lParam >> 16);
                         Resized(clientSize / Scaling);