From 5ee76faabdc59f6b3d5e7fc460d5924e204c4915 Mon Sep 17 00:00:00 2001 From: Emmanuel Hansen Date: Wed, 19 Jul 2023 13:24:55 +0000 Subject: [PATCH] fix no border resize issue --- src/Windows/Avalonia.Win32/WindowImpl.AppWndProc.cs | 2 +- src/Windows/Avalonia.Win32/WindowImpl.cs | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/Windows/Avalonia.Win32/WindowImpl.AppWndProc.cs b/src/Windows/Avalonia.Win32/WindowImpl.AppWndProc.cs index 9a7f4b62e3..bdeda9236f 100644 --- a/src/Windows/Avalonia.Win32/WindowImpl.AppWndProc.cs +++ b/src/Windows/Avalonia.Win32/WindowImpl.AppWndProc.cs @@ -59,7 +59,7 @@ namespace Avalonia.Win32 case WindowsMessage.WM_NCCALCSIZE: { - if (ToInt32(wParam) == 1 && !HasFullDecorations || _isClientAreaExtended) + if (ToInt32(wParam) == 1 && _isClientAreaExtended) { return IntPtr.Zero; } diff --git a/src/Windows/Avalonia.Win32/WindowImpl.cs b/src/Windows/Avalonia.Win32/WindowImpl.cs index 044c2cad67..154b20ef84 100644 --- a/src/Windows/Avalonia.Win32/WindowImpl.cs +++ b/src/Windows/Avalonia.Win32/WindowImpl.cs @@ -1340,14 +1340,12 @@ namespace Avalonia.Win32 if (!_isFullScreenActive) { - var margin = newProperties.Decorations == SystemDecorations.BorderOnly ? 1 : 0; - var margins = new MARGINS { - cyBottomHeight = margin, - cxRightWidth = margin, - cxLeftWidth = margin, - cyTopHeight = margin + cyBottomHeight = 0, + cxRightWidth = 0, + cxLeftWidth = 0, + cyTopHeight = 0 }; DwmExtendFrameIntoClientArea(_hwnd, ref margins);