WindowsAppSDK
WindowsAppSDK copied to clipboard
Apply Backdrop's FallbackColor to Window on Windows 10
Describe the bug
Currently the backdrop APIs are not supported on Windows 10. Trying to apply the backdrop will throw an exception. Instead allow us to apply the backdrop to Windows 10, but use the fallback color. It is possible in Windows 10 to set a background color, so why not use the fallback for this? Without this, it is almost impossible to use the backdrops and still make it look decent on Windows 10. We have to resort to having to check the issupported call, and then insert a solid color brush in the root content of the window instead. This is way more code than we should need to write.
Of course polyfilling the backdrops is the best thing to do, but until then, it seems like a small ask to just apply the fallback color to the window.
Steps to reproduce the bug
Apply a backdrop to a Window if supported - do not apply a background brush to the content (so we can see the backdrop). Run the application on Windows 11, and check things look great in darkmode. Repeat on Windows 10 and notice that since we're not applying the backdrop, the app now renders with a white background, and all the content is also white and unreadable.
Expected behavior
Allow applying backdrops on Windows 10 without throwing, and apply the fallback color.
Screenshots
No response
NuGet package version
1.1.0
Packaging type
Packaged (MSIX)
Windows version
Windows 10 version 21H2 (19044, November 2021 Update)
IDE
Visual Studio 2022-preview, Visual Studio 2022
Additional context
No response
As someone said, "Currently, it takes a lot of code to set a backdrop. It will be simplified in a future release." (Paraphrasing based on my memory).
Backdrop and title bar are definitely something that requires a messy set of codes right now. Shrestha Files now have acrylic and mica backdrop for Windows 11 and in app acrylic for Windows 10 and 11.
Also, reapplying mica and acrylic twice crashes the app with win32 error.
It has completely different (looking) implementation of full screen title bars for Windows 10 and Windows 11. So, creating a consistent look in Windows 10 and 11 is quite challenging right now.
Also, reapplying mica and acrylic twice crashes the app with win32 error.
Probably better to log a bug than to “log” it as part of a comment on a different issue
I agree using the FallbackColor downlevel is the right design. Internal tracking issue.
@JPTGamesAndApps The issue you mention sounds like what happens if Close()
isn't called on the old controller when it is removed. If that doesn't fix it, please link to a bug you logged for that so we can track that.
I can confirm the following:
-
We are providing the fallback color support downlevel in 1.2.
-
We are also looking at making the overall process for Mica/Acrylic simpler.
@ChewWorker Awesome! I'll remove my fallback workaround in WinUIEx for v1.2 then
Closing since this is complete and works on my machine :D