Skip to content

Fix dark theme rendering as pure black when Mica can't paint#5130

Merged
Gabriel Dufresne (GabrielDuf) merged 1 commit into
mainfrom
fix/mica-black-background-5111
Jul 17, 2026
Merged

Fix dark theme rendering as pure black when Mica can't paint#5130
Gabriel Dufresne (GabrielDuf) merged 1 commit into
mainfrom
fix/mica-black-background-5111

Conversation

@GabrielDuf

Copy link
Copy Markdown
Contributor

This pull request improves the reliability and user experience of the Mica visual effect on Windows 11 by adding a fallback mechanism for situations where Mica is unavailable. If the system or hardware cannot provide the Mica effect, the application will now automatically revert to a solid background, preventing rendering issues like pure black windows. The changes also ensure that all surfaces consistently use the fallback style once Mica is confirmed unavailable.

Mica fallback and reliability improvements:

  • Added a _micaConfirmedUnavailable flag and a NotifyMicaUnavailable() method in MicaWindowHelper to globally disable Mica and remove related styles if the effect is confirmed unavailable.
  • Updated the IsMicaEnabled() logic to check for hardware acceleration and the new _micaConfirmedUnavailable flag, ensuring Mica is only used when supported.
  • Modified ApplyAcrylicToPopup to skip applying acrylic if Mica is not enabled, preventing visual glitches on unsupported systems.

Main window handling:

  • In MainWindow.axaml.cs, added logic to detect when Mica is unavailable (WindowTransparencyLevel.None), call NotifyMicaUnavailable(), and set a solid background brush as a fallback.

Code organization:

  • Added a missing using directive for UniGetUI.Avalonia.Assets.Styles to support style removal in MicaWindowHelper.

@GabrielDuf
Gabriel Dufresne (GabrielDuf) merged commit 33ef136 into main Jul 17, 2026
14 checks passed
@GabrielDuf
Gabriel Dufresne (GabrielDuf) deleted the fix/mica-black-background-5111 branch July 17, 2026 18:05
@GabrielDuf Gabriel Dufresne (GabrielDuf) linked an issue Jul 17, 2026 that may be closed by this pull request
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

[IMPROVEMENT] The new dark mode is too black

2 participants