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 and grokys committed Jul 22, 2024
1 parent 2ba4551 commit ded5caa
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 @@ -773,6 +773,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 ded5caa

Please sign in to comment.