Browse Source

fix #2166 black area on windows

pull/2211/head
ahopper 8 years ago
parent
commit
67b0db9954
  1. 11
      src/Windows/Avalonia.Win32/WindowImpl.cs

11
src/Windows/Avalonia.Win32/WindowImpl.cs

@ -153,17 +153,20 @@ namespace Avalonia.Win32
public void Resize(Size value) public void Resize(Size value)
{ {
if (value != ClientSize) var clientRect = ClientSize;
if (value != clientRect)
{ {
value *= Scaling; value *= Scaling;
UnmanagedMethods.RECT windowRect;
UnmanagedMethods.GetWindowRect(_hwnd, out windowRect);
UnmanagedMethods.SetWindowPos( UnmanagedMethods.SetWindowPos(
_hwnd, _hwnd,
IntPtr.Zero, IntPtr.Zero,
0, 0,
0, 0,
(int)value.Width, (int)(value.Width + (windowRect.Width - clientRect.Width)),
(int)value.Height, (int)(value.Height + (windowRect.Height - clientRect.Height)),
UnmanagedMethods.SetWindowPosFlags.SWP_RESIZE); UnmanagedMethods.SetWindowPosFlags.SWP_RESIZE);
} }
} }

Loading…
Cancel
Save