From c4ae3b7c9efdb8214b0a51e238987d7ce6e06ad1 Mon Sep 17 00:00:00 2001 From: Emmanuel Hansen Date: Fri, 14 Jun 2024 14:03:15 +0000 Subject: [PATCH] win32- set internal _shown flag if ShowWindow will make window visible --- src/Windows/Avalonia.Win32/WindowImpl.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Windows/Avalonia.Win32/WindowImpl.cs b/src/Windows/Avalonia.Win32/WindowImpl.cs index e2fb60f4cad7..ca1afc9b6e56 100644 --- a/src/Windows/Avalonia.Win32/WindowImpl.cs +++ b/src/Windows/Avalonia.Win32/WindowImpl.cs @@ -1203,6 +1203,11 @@ private void ShowWindow(WindowState state, bool activate) if (command.HasValue) { UnmanagedMethods.ShowWindow(_hwnd, command.Value); + + if (!_shown && command.Value != ShowWindowCommand.Minimize && GetStyle().HasFlag(WindowStyles.WS_VISIBLE)) + { + _shown = true; + } } if (state == WindowState.Maximized)