Fix dark theme rendering as pure black when Mica can't paint#5130
Merged
Gabriel Dufresne (GabrielDuf) merged 1 commit intoJul 17, 2026
Conversation
Marc-André Moreau (mamoreau-devolutions)
approved these changes
Jul 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
_micaConfirmedUnavailableflag and aNotifyMicaUnavailable()method inMicaWindowHelperto globally disable Mica and remove related styles if the effect is confirmed unavailable.IsMicaEnabled()logic to check for hardware acceleration and the new_micaConfirmedUnavailableflag, ensuring Mica is only used when supported.ApplyAcrylicToPopupto skip applying acrylic if Mica is not enabled, preventing visual glitches on unsupported systems.Main window handling:
MainWindow.axaml.cs, added logic to detect when Mica is unavailable (WindowTransparencyLevel.None), callNotifyMicaUnavailable(), and set a solid background brush as a fallback.Code organization:
UniGetUI.Avalonia.Assets.Stylesto support style removal inMicaWindowHelper.