microsoft-ui-xaml icon indicating copy to clipboard operation
microsoft-ui-xaml copied to clipboard

[API Spec] SystemBackdropElement: WinUI3 Background Acrylic Support

Open godlytalias opened this issue 2 months ago • 13 comments

This is the API Spec for the proposed SystemBackdropElement control for supporting Acrylic effect in WinUI3 for controls other than Window & Flyouts

PR Type

Please check the type of change your PR introduces:

  • [ ] Bugfix
  • [ ] Feature
  • [ ] Code style update (formatting, renaming)
  • [ ] Refactoring (no functional changes, no api changes)
  • [ ] Build related changes
  • [x] Documentation content changes
  • [ ] Other (please describe):

Description

Current Behavior

New Behavior

Motivation and Context

How Has This Been Tested?

  • [ ] I have performed a self-review of my own code
  • [ ] I have added tests to cover my changes

Screenshots (if appropriate):

godlytalias avatar Oct 14 '25 18:10 godlytalias

After the official release of SystemBackdropHost, can WinUI 3 add SystemBackdrop in some pop-up Windows to maintain the consistency of the background color of WinUI 3 and WinUI 2 controls? For example: TeachingTip, ToolTip, Commandbar SecondaryCommands, Combobox popup menu, etc... @godlytalias @AjitSurana

Gaoyifei1011 avatar Oct 18 '25 03:10 Gaoyifei1011

This sounds like only the first step required to support a truly UWP-like acrylic-based popup. To fix the existing issues, developer effort still seems necessary to manually rewrite existing ControlTemplate.

It's better to just fix all those issues by updating all those existing controls' ControlTemplate so that no developer effort is needed.

HO-COOH avatar Oct 20 '25 07:10 HO-COOH

This sounds like only the first step required to support a truly UWP-like acrylic-based popup. To fix the existing issues, developer effort still seems necessary to manually rewrite existing ControlTemplate.

It's better to just fix all those issues by updating all those existing controls' ControlTemplate so that no developer effort is needed.

@HO-COOH Thanks for the response, If we update the template of all controls, that would hit hard on the fundamentals as we would be creating containers to hold the placementVisual and the usage of systembackdrop is not justifying to do such a change. Hence we decided to go with a control which developer can easily add to the place wherever they need to have a backdrop.

godlytalias avatar Oct 23 '25 08:10 godlytalias

@godlytalias Can we use it in next release? (v2.0-exp2)

ghost1372 avatar Oct 23 '25 09:10 ghost1372

@godlytalias Can we use it in next release? (v2.0-exp2)

@ghost1372 Yes it will be available in exp2 release

godlytalias avatar Oct 25 '25 05:10 godlytalias

@HO-COOH Thanks for the response, If we update the template of all controls, that would hit hard on the fundamentals as we would be creating containers to hold the placementVisual and the usage of systembackdrop is not justifying to do such a change. Hence we decided to go with a control which developer can easily add to the place wherever they need to have a backdrop.

@godlytalias If that's the case, is there any difference between this and my AcrylicVisual? My existing solution to all these issues also works by finding a place (create one, usually a container if no suitable place), add this acrylic visual.

HO-COOH avatar Oct 27 '25 03:10 HO-COOH

@HO-COOH Thanks for the response, If we update the template of all controls, that would hit hard on the fundamentals as we would be creating containers to hold the placementVisual and the usage of systembackdrop is not justifying to do such a change. Hence we decided to go with a control which developer can easily add to the place wherever they need to have a backdrop.

@godlytalias If that's the case, is there any difference between this and my AcrylicVisual? My existing solution to all these issues also works by finding a place (create one, usually a container if no suitable place), add this acrylic visual.

@HO-COOH I see you're using ContentExternalBackdropLink, so conceptually it would be same. However, ContentExternalBackdropLink API is experimental and so apps won't be able to publish by using it. There is some concerns around making ContentExternalBackdropLink stable in current shape. Hence providing this control in WinUI layer for achieving backdrops. Moreover I see you're trying to achieve backdrop behavior in combobox, Better way to achieve that may be to apply a custom style of combobox where a SystemBackdrop would be applied on the Popup in the control template. There is a known issue in positioning of backdrop in that way which would get addressed in upcoming release.

godlytalias avatar Oct 28 '25 08:10 godlytalias

I've added this to the public api review process board: https://aka.ms/winappsdk/api-specs-review

This PR will be open for feedback for a month from its opening: October 14th – November 14th

FYI @godlytalias

michael-hawker avatar Oct 30 '25 22:10 michael-hawker

Can this help to the WebView2 control to get acrylic/mica background so that if the web page rendered is transparent, it can show the acrylic/mica background? (so that it feels more integrated with Windows)

Diegorro98 avatar Nov 06 '25 20:11 Diegorro98

In the current implementation, a change of the SystemBackdrop property (e.g. in a visual state) leads to a crash because changing the SystemBackdrop property of the object implementing ICompositionSupportsSystemBackdrop does not seem to be supported. This limitation should either be fixed in the code or pointed out in the documentation.

lhak avatar Nov 18 '25 08:11 lhak

In the current implementation, a change of the SystemBackdrop property (e.g. in a visual state) leads to a crash because changing the SystemBackdrop property of the object implementing ICompositionSupportsSystemBackdrop does not seem to be supported. This limitation should either be fixed in the code or pointed out in the documentation.

@lhak Whether you're mentioning about a scenario where the SystemBackdrop property getting updated for the control? I've tested this scenario and didn't see a crash. Could you please clarify more on the repro steps? Thanks

godlytalias avatar Nov 20 '25 13:11 godlytalias

In the current implementation, a change of the SystemBackdrop property (e.g. in a visual state) leads to a crash because changing the SystemBackdrop property of the object implementing ICompositionSupportsSystemBackdrop does not seem to be supported. This limitation should either be fixed in the code or pointed out in the documentation.

@lhak Whether you're mentioning about a scenario where the SystemBackdrop property getting updated for the control? I've tested this scenario and didn't see a crash. Could you please clarify more on the repro steps? Thanks

I have investigated this issue again and noticed that switching between the mica and acrylic system backdrops worked fine, but using my custom backdrop caused a crash. I have now found the reason: If the SystemBackdrop property has been set once, then future changes require the backdrop implementation to reuse the compositor of the initial backdrop object. Otherwise, an unauthorized exception will be thrown. I think this should be documented, probably in the ICompositionSupportsSystemBackdrop documentation. Open sourcing the implementation of the inbox backdrops (e.g. MicaController) would also be very helpful.

lhak avatar Nov 21 '25 08:11 lhak

Feedback gathering date for this PR has passed; what's the status?

riverar avatar Dec 10 '25 20:12 riverar

Ping @godlytalias

riverar avatar Dec 15 '25 01:12 riverar

@godlytalias The continued silence on this PR is making it hard for the community to engage productively. Could you weigh in as soon as you can? Thanks!

riverar avatar Dec 17 '25 17:12 riverar

@pranav-gupta-msft Can you also chime in here? Why is your team so unresponsive/slow?

riverar avatar Dec 17 '25 22:12 riverar