Skip to content

Commit

Permalink
Extend the client area when a Win32 window is opened in maximised sta…
Browse files Browse the repository at this point in the history
…te (#16593)
  • Loading branch information
TomEdwardsEnscape authored Aug 16, 2024
1 parent 228ecc5 commit ea236e2
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/Windows/Avalonia.Win32/WindowImpl.AppWndProc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -614,12 +614,7 @@ protected virtual unsafe IntPtr AppWndProc(IntPtr hWnd, uint msg, IntPtr wParam,
break;

case WindowsMessage.WM_SHOWWINDOW:
_shown = wParam != default;

if (_isClientAreaExtended)
{
ExtendClientArea();
}
OnShowHideMessage(wParam != default);
break;

case WindowsMessage.WM_SIZE:
Expand Down Expand Up @@ -801,11 +796,11 @@ protected virtual unsafe IntPtr AppWndProc(IntPtr hWnd, uint msg, IntPtr wParam,
var winPos = Marshal.PtrToStructure<WINDOWPOS>(lParam);
if((winPos.flags & (uint)SetWindowPosFlags.SWP_SHOWWINDOW) != 0)
{
_shown = true;
OnShowHideMessage(true);
}
else if ((winPos.flags & (uint)SetWindowPosFlags.SWP_HIDEWINDOW) != 0)
{
_shown = false;
OnShowHideMessage(false);
}
break;
}
Expand Down Expand Up @@ -854,6 +849,16 @@ protected virtual unsafe IntPtr AppWndProc(IntPtr hWnd, uint msg, IntPtr wParam,
return DefWindowProc(hWnd, msg, wParam, lParam);
}

private void OnShowHideMessage(bool shown)
{
_shown = shown;

if (_isClientAreaExtended)
{
ExtendClientArea();
}
}

private Lazy<IReadOnlyList<RawPointerPoint>?>? CreateLazyIntermediatePoints(POINTER_INFO info)
{
var historyCount = Math.Min((int)info.historyCount, MaxPointerHistorySize);
Expand Down

0 comments on commit ea236e2

Please sign in to comment.