Open Balkoth opened 2 years ago
It works fine for me (Windows 10 21H1, Windows app SDK 1.1.0) :
The bug is also present in 1.1.5 for me.
@castorix I think you got wrong what i said. If i use SetPreferredAppMode this of course works. But i should not have to use an undocumented function, this should work out of the box.
The bug is also present in 1.1.5 for me.
@castorix I think you got wrong what i said. If i use SetPreferredAppMode this of course works. But i should not have to use an undocumented function, this should work out of the box.
Ah ok. I thought it did not work on Windows 10 21H2 Indeed, we should not have to call undocumented APIs for this
This is not a bug per se, it is how win32 works today - if you just create a window in a "blank app" in win32 you will get the light theme system menu, this is the same for a WinUI WinAppSDK app.
I do however agree that this does not look good, and at least WinAppSDK apps should properly handle light/dark mode out of the box with no need for developers to do anything special. @MikeHillberg @ryandemopoulos - I think this (theme/mode aware) is something that needs a broader support/investment across components of WinAppSDK.
With that in mind, I'd like to see this converted from a bug into a feature suggestion.
Windows explorer says otherwise, it switches to the correct menu theme upon changing from light to dark. Every app that does not reflect this looks buggy to me, so i consider this to be a bug.
Related: #41
Since I'm no longer PM:ing this area I'm unassigning me. @MikeHillberg and @ryandemopoulos (who've been assigned for a while as well) will continue to drive this topic.
Describe the bug
Apps on a system that is configured to use the dark theme use the light system context menu theme:
Context menu looks like this:
When it should look like this:
Steps to reproduce the bug
Create a new project on a system that is configured to use dark mode.
Expected behavior
No response
Screenshots
No response
NuGet package version
1.1.4
Packaging type
Packaged (MSIX), Unpackaged
Windows version
Windows 10 version 21H2 (19044, November 2021 Update)
IDE
Visual Studio 2022
Additional context
The right theme for the context menue is chosen when you call into an undocumented function in uxtheme.dll:
According to this there are a number of values for the int parameter.
Call this function on program start to choose the right mode for the current configuration.