Browse Source
Merge pull request #12257 from AvaloniaUI/fixes/window-border-resize
Fix windows with BorderOnly decoration being unresizable
pull/12327/head
Nikita Tsukanov
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
5 additions and
7 deletions
-
src/Windows/Avalonia.Win32/WindowImpl.AppWndProc.cs
-
src/Windows/Avalonia.Win32/WindowImpl.cs
|
|
|
@ -59,7 +59,7 @@ namespace Avalonia.Win32 |
|
|
|
|
|
|
|
case WindowsMessage.WM_NCCALCSIZE: |
|
|
|
{ |
|
|
|
if (ToInt32(wParam) == 1 && !HasFullDecorations || _isClientAreaExtended) |
|
|
|
if (ToInt32(wParam) == 1 && _windowProperties.Decorations == SystemDecorations.None || _isClientAreaExtended) |
|
|
|
{ |
|
|
|
return IntPtr.Zero; |
|
|
|
} |
|
|
|
|
|
|
|
@ -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); |
|
|
|
|