From d43108d442e09b61c53b173d2537428f503da8ee Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Wed, 20 May 2020 16:55:32 -0300 Subject: [PATCH] only report extended if we were able to. --- src/Windows/Avalonia.Win32/WindowImpl.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Windows/Avalonia.Win32/WindowImpl.cs b/src/Windows/Avalonia.Win32/WindowImpl.cs index 6cacd0b6cc..af1e8e06ce 100644 --- a/src/Windows/Avalonia.Win32/WindowImpl.cs +++ b/src/Windows/Avalonia.Win32/WindowImpl.cs @@ -692,14 +692,12 @@ namespace Avalonia.Win32 var hr = DwmExtendFrameIntoClientArea(_hwnd, ref margins); - //if (hr < 0) + if (hr == 0) { - // Handle the error. + _isClientAreaExtended = true; + _extendedMargins = new Thickness(margins.cxLeftWidth / Scaling, margins.cyTopHeight / Scaling, margins.cxRightWidth / Scaling, margins.cyBottomHeight / Scaling); + ExtendClientAreaToDecorationsChanged?.Invoke(true); } - - _isClientAreaExtended = true; - _extendedMargins = new Thickness(margins.cxLeftWidth / Scaling, margins.cyTopHeight / Scaling, margins.cxRightWidth / Scaling, margins.cyBottomHeight / Scaling); - ExtendClientAreaToDecorationsChanged?.Invoke(true); } }