From 15290a3240c18507c28aa4895234476e7ff0fde0 Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Sat, 19 Aug 2023 13:31:47 +0100 Subject: [PATCH] win32: make setting ShowInTaskbar = true on an owned window that is already shown, not remove the ownership This makes us consistent with WPF. --- src/Windows/Avalonia.Win32/WindowImpl.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Windows/Avalonia.Win32/WindowImpl.cs b/src/Windows/Avalonia.Win32/WindowImpl.cs index 154b20ef84..e9156e553d 100644 --- a/src/Windows/Avalonia.Win32/WindowImpl.cs +++ b/src/Windows/Avalonia.Win32/WindowImpl.cs @@ -683,9 +683,10 @@ namespace Avalonia.Win32 if (parentHwnd == IntPtr.Zero && !_windowProperties.ShowInTaskbar) { parentHwnd = OffscreenParentWindow.Handle; - _hiddenWindowIsParent = true; } + _hiddenWindowIsParent = parentHwnd == OffscreenParentWindow.Handle; + SetWindowLongPtr(_hwnd, (int)WindowLongParam.GWL_HWNDPARENT, parentHwnd); }