Skip to content

Fix: White-flashing during fade-in animation on Windows 10 - #100

Merged
G-Stas merged 5 commits into
G-Stas:mainfrom
ElektroStudios:main
Oct 27, 2026
Merged

G-Stas merged 5 commits into
G-Stas:mainfrom
ElektroStudios:main

Conversation

@ElektroStudios

@ElektroStudios ElektroStudios commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Description

This PR addresses an annoying visual glitch where a harsh white flash appears during the fade-in animation, which completely breaks the smoothness of the user interface. The transition is now seamless and visually pleasant.

Note on authoring: I am not a C# or WPF developer by trade. I simply spotted this dreadful flashing effect, couldn't stand looking at it, and used an AI assistant to guide me step-by-step through the exact codebase modifications required to fix it. The logic has been tested locally on Windows 10, and it works flawlessly.

Note: also applied little refactors suggested by Visual Studio IDE, like adding the static access modifier to GetTaskBarLocation.

Visual Comparison

❌ Before ✅ After
before after

@ElektroStudios ElektroStudios changed the title Fixed white-flashing fade-in animation Fix: White-flashing during fade-in animation Oct 26, 2026

@G-Stas G-Stas left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea is right overall but needs several changes before merge

Comment thread UpgradeLog.htm Resolved
Comment thread Volumey/View/MainView.xaml.cs Resolved
Comment thread Volumey/View/MainView.xaml.cs Resolved
Comment thread Volumey/View/MainView.xaml.cs Resolved
Comment thread Volumey/View/MainView.xaml Resolved
Comment thread Volumey/View/MainView.xaml.cs Resolved
@ElektroStudios
ElektroStudios requested a review from G-Stas October 27, 2026 00:26

@G-Stas G-Stas left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few more things to fix, also UpgradeLog.htm should be deleted

Comment thread Volumey/View/MainView.xaml.cs Resolved
Comment thread Volumey/View/MainView.xaml.cs Resolved
Comment thread Volumey/View/MainView.xaml.cs Resolved
@ElektroStudios

ElektroStudios commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor Author

I have applied the requested changes:

  • Dropped DwmFlush() from EndCloak().
  • Extracted StopUncloakSequence() and called it both at the start of EndCloak() and when hiding the window.
  • Made OnIsVisibleChanged synchronous (removed async/await).
  • Removed the leftover UpgradeLog.htm file.

Regarding cloaking immediately on hide: while testing SetCloaked(true) right away inside if(!isVisible), I noticed that applying DWMWA_CLOAK immediately causes DWM to abruptly cut off the native closing fade-out transition on Windows 10, making the window vanish harsh and instantly instead of fading out smoothly.

To preserve the smooth closing transition while still addressing your concern about a quick reopen being left uncloaked (and keeping the handler synchronous), I implemented a small DispatcherTimer (cloakOnHideTimer) synced to the HideFadeOut duration:

  1. On Hide (!isVisible): It calls StopUncloakSequence() immediately and starts cloakOnHideTimer to apply SetCloaked(true) right as the closing transition finishes.
  2. On Show (StartUncloakSequence): It immediately stops cloakOnHideTimer and calls SetCloaked(true) at the very beginning of StartUncloakSequence(). This guarantees that even if the user reopens the mixer within that ~120 ms window before the hide timer ticks, the window is immediately cloaked before rendering, completely preventing any uncloaked quick-reopen glitch.

Let me know if this approach works for you, or if you still prefer dropping the closing transition in favor of an instant SetCloaked(true) on hide!

@ElektroStudios
ElektroStudios requested a review from G-Stas October 27, 2026 19:00
@ElektroStudios ElektroStudios changed the title Fix: White-flashing during fade-in animation Fix: White-flashing during fade-in animation on Windows 10 Oct 27, 2026
G-Stas
G-Stas previously approved these changes Oct 27, 2026

@G-Stas G-Stas left a comment •

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you! One thing to remove and I'll merge it

Comment thread Volumey/NativeMethods.txt Outdated
WM_GETICON
ICON_BIG
ICON_SMALL2
DwmFlush

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DwmFlush is not needed there anymore

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excuse me. Removal done!

@G-Stas G-Stas added the bug Something isn't working label Oct 27, 2026
@G-Stas
G-Stas merged commit 14bd7d5 into G-Stas:main Oct 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants