diff --git a/src/Windows/Avalonia.Win32/WindowImpl.AppWndProc.cs b/src/Windows/Avalonia.Win32/WindowImpl.AppWndProc.cs index 737172943b7..29d4a614dea 100644 --- a/src/Windows/Avalonia.Win32/WindowImpl.AppWndProc.cs +++ b/src/Windows/Avalonia.Win32/WindowImpl.AppWndProc.cs @@ -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(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