Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing Mica backdrop in ActualThemeChanged event causes backdrop to render wrong #10212

Open
dotMorten opened this issue Dec 8, 2022 · 3 comments
Labels
area-Materials Reveal, Acrylic, lighting, etc. team-CompInput Issue for IXP (Composition, Input) team

Comments

@dotMorten
Copy link
Contributor

dotMorten commented Dec 8, 2022

Describe the bug

I want to change my tint opacity of mica when in dark mode. However when I switch darkmode, setting the tint opacity in the ActualThemeChanged event causes the entire backdrop to render completely wrong.

I also notice that if I delay setting the TintOpacity override, or I don't override it at all, things render just fine.

Steps to reproduce the bug

  1. Unzip the repro project: MicaBugRepro.zip
  2. Launch app and use the dropdown to switch to dark-mode. Notice most text is getting unreadable.
  3. Switch back to light mode, and flip one of the two switches.
  4. Switch to dark mode again, and notice there is no issue.

Expected behavior

Dark mode renders correctly, regardless of if/when TintOpacity is applied.

Screenshots

Untitled.Project.mp4

NuGet package version

Windows App SDK 1.2.1: 1.2.221116.1

Packaging type

Packaged (MSIX)

Windows version

Windows 11 version 22H2 (22621, 2022 Update)

IDE

Visual Studio 2022

Additional context

Reproduced with 1.1.5, 1.2 preview, and 1.2.221116.1

@zhuxb711
Copy link
Contributor

if comment this out, then the theme would not be changed as expected

micaController.ResetProperties()

@zhuxb711
Copy link
Contributor

zhuxb711 commented Dec 23, 2022

Inclusion:

The code would not works

BackdropConfiguration.Theme = SystemBackdropTheme.Dark //Or SystemBackdropTheme.Light

The code would not works too

BackdropConfiguration.Theme = SystemBackdropTheme.Dark //Or SystemBackdropTheme.Light
micaController.ResetProperties();
micaController.TintColor = //Your Color
micaController.TintOpacity = //Your TintOpacity 
micaController.LuminosityOpacity = //Your LuminosityOpacity

The code would works as expected

BackdropConfiguration.Theme = SystemBackdropTheme.Dark //Or SystemBackdropTheme.Light
micaController.ResetProperties();

@dotMorten I also seem this issue in DesktopAcrylicController not only in MicaController

@zhuxb711
Copy link
Contributor

For DesktopAcrylicController, those bugs would found.

Set TintOpacity property only would not takes effect

//Change TintOpacity only would not takes effect
acrylicController.TintOpacity = //Your TintOpacity 

Set TintOpacity and LuminosityOpacity property would takes effect

//Change TintOpacity and LuminosityOpacity would takes effect
acrylicController.TintOpacity = //Your TintOpacity 
acrylicController.LuminosityOpacity = //Your LuminosityOpacity

@codendone codendone transferred this issue from microsoft/WindowsAppSDK Dec 2, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Dec 2, 2024
@codendone codendone added area-Materials Reveal, Acrylic, lighting, etc. team-CompInput Issue for IXP (Composition, Input) team and removed bug Something isn't working needs-triage Issue needs to be triaged by the area owners labels Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Materials Reveal, Acrylic, lighting, etc. team-CompInput Issue for IXP (Composition, Input) team
Projects
None yet
Development

No branches or pull requests

4 participants