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

WinUI 3 does not use the darker shadow for dark mode windows #8376

Open
BreeceW opened this issue Apr 9, 2023 · 0 comments
Open

WinUI 3 does not use the darker shadow for dark mode windows #8376

BreeceW opened this issue Apr 9, 2023 · 0 comments
Labels
area-Windowing bug Something isn't working team-CompInput Issue for IXP (Composition, Input) team

Comments

@BreeceW
Copy link
Contributor

BreeceW commented Apr 9, 2023

Describe the bug

Apps in dark mode on Windows (UWP dark mode or Win32 apps that set DWMWA_USE_IMMERSIVE_DARK_MODE) get a larger shadow, which makes them more visible, as the shadow is harder to see in dark mode otherwise. WinUI 3 does not use this larger shadow in dark mode, so they have worse contrast when glancing at open windows.

Steps to reproduce the bug

Compare the shadows of a UWP app when the light/dark mode settings are changed in Windows Settings and observe that the shadow grows in dark mode.
Then, look at a WinUI 3 app and observe that the shadow stays the same.

Note: This all assumes that Window.ExtendsContentIntoTitleBar was not set to true. Setting that to true turns immersive dark mode on, even if the app is in light mode. That results in a shadow that is too dark for light mode. See #8377.

Expected behavior

In dark mode, the shadow should be bigger/darker.

Screenshots

Comparison of UWP light/dark with small/heavy shadows vs. WinUI 3 with light/dark and only small shadows
It’s a little hard to see, but UWP/immersive in dark mode has a bolder, darker shadow than in light mode. WinUI 3 should use that darker shadow when dark mode is on.

NuGet package version

WinUI 3 - Windows App SDK 1.2.5: 1.2.230313.1

Windows version

Windows 11 (22H2): Build 22621

Additional context

This could be implemented by setting DWMWA_USE_IMMERSIVE_DARK_MODE to true when the WinUI 3 app is in dark mode.

A workaround for this problem exists and is rather easy:
Simply call DwmSetWindowAttribute(WindowNative.GetWindowHandle(this), DWMWA_USE_IMMERSIVE_DARK_MODE, ...) with true or false as the value depending on whether your app is in dark or light mode. Make sure to update it when theme changes occur.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Windowing bug Something isn't working team-CompInput Issue for IXP (Composition, Input) team
Projects
None yet
Development

No branches or pull requests

2 participants