Skip to content

Commit

Permalink
Win32 - set internal _shown flag if ShowWindow will make window visib…
Browse files Browse the repository at this point in the history
…le (#16029)

* win32- set internal _shown flag if ShowWindow will make window visible

* check window visibility state from WM_WINDOWPOSCHANGED message
  • Loading branch information
emmauss authored Jun 18, 2024
1 parent af104b9 commit 87ea0d2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Windows/Avalonia.Win32/WindowImpl.AppWndProc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,17 @@ protected virtual unsafe IntPtr AppWndProc(IntPtr hWnd, uint msg, IntPtr wParam,
return UiaCoreProviderApi.UiaReturnRawElementProvider(_hwnd, wParam, lParam, node);
}
break;
case WindowsMessage.WM_WINDOWPOSCHANGED:
var winPos = Marshal.PtrToStructure<WINDOWPOS>(lParam);
if((winPos.flags & (uint)SetWindowPosFlags.SWP_SHOWWINDOW) != 0)
{
_shown = true;
}
else if ((winPos.flags & (uint)SetWindowPosFlags.SWP_HIDEWINDOW) != 0)
{
_shown = false;
}
break;
}

#if USE_MANAGED_DRAG
Expand Down

0 comments on commit 87ea0d2

Please sign in to comment.