From fe18b91aefb1569112d660896ec434abe4b08537 Mon Sep 17 00:00:00 2001 From: h3xds1nz Date: Sun, 28 Jun 2026 13:59:19 +0200 Subject: [PATCH] Fix Popup Flicker caused by repositioning a fading out root --- .../System/Windows/Controls/Primitives/Popup.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/Primitives/Popup.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/Primitives/Popup.cs index 7f88b405643..1be9efe1f0a 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/Primitives/Popup.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/Primitives/Popup.cs @@ -1517,7 +1517,10 @@ private void CreateWindow(bool asyncCall) // This ensures that a recycled HWND that is moving from one display // to another does not undergo a WM_DPICHANGED event and thus cause a // cascading failure. - if (PopupInitialPlacementHelper.IsPerMonitorDpiScalingActive) + // Also create a new window if the popup animation is set to Fade, + // otherwise reusing the same window will interrupt the fade-out animation, + // causing together with the call to SetWindowPos a brief flicker instead of smooth fade-in. + if (PopupInitialPlacementHelper.IsPerMonitorDpiScalingActive || PopupAnimation is PopupAnimation.Fade) { DestroyWindowImpl(); _positionInfo = null;