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

Acrylic Brush doesn't work in combobox #9523

Open
winnative opened this issue Apr 9, 2024 · 5 comments
Open

Acrylic Brush doesn't work in combobox #9523

winnative opened this issue Apr 9, 2024 · 5 comments
Labels
area-ComboBox area-Materials Reveal, Acrylic, lighting, etc. area-Popup bug Something isn't working team-Controls Issue for the Controls team

Comments

@winnative
Copy link

Describe the bug

I defined a ComboBox and saw that acrylic brush doesn't work in the Popup list of the ComboBox.

Steps to reproduce the bug

  1. Define a ComboBox
  2. See that Acrylic Brush doesn't work in Popup of Items

Expected behavior

No response

Screenshots

No response

NuGet package version

WinUI 3 - Windows App SDK 1.5.1: 1.5.240311000

Windows version

Windows 11 (22H2): Build 22621, Windows 11 (21H2): Build 22000

Additional context

No response

@winnative winnative added the bug Something isn't working label Apr 9, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Apr 9, 2024
Copy link

github-actions bot commented Apr 9, 2024

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@codendone codendone added area-ComboBox area-Materials Reveal, Acrylic, lighting, etc. team-Controls Issue for the Controls team area-Popup bug Something isn't working and removed bug Something isn't working needs-triage Issue needs to be triaged by the area owners labels Apr 12, 2024
@codendone
Copy link
Contributor

This comes from Composition differences in WinAppSDK. AcrylicBrush is only able to blur other content drawn by WinAppSDK in the same window. For windowed popups (those with ShouldConstrainToRootBounds="false"), which ComboBox uses, the AcrylicBrush can only blur content below it in that popup window. Using Popup.SystemBackdrop can enable acrylic across the window boundary.

It looks Combobox styles attempt to set an acrylic background by using AcrylicBrush (via the ComboBoxDropDownBackground resource). It needs to change to use SystemBackdrop for this to work.

@shatyuka
Copy link

@codendone If I use SystemBackdrop in ComboBox style, it will show a transparent background. Any idea?

<StaticResource x:Key="ComboBoxDropDownBackground" ResourceKey="DesktopAcrylicTransparentBrush" />
<Popup x:Name="Popup"
       SystemBackdrop="{StaticResource AcrylicBackgroundFillColorDefaultBackdrop}"
       Grid.Row="0"
       Grid.Column="0">

@gegao18
Copy link

gegao18 commented Jul 26, 2024

@shatyuka You'll need to specify ShouldConstrainToRootBounds="False" on that popup as well. That will allow the popup to escape the bounds of its island (e.g. the ComboBox dropdown can go outside the window bounds), and lets the SystemBackdrop render desktop acrylic.

@shatyuka
Copy link

@shatyuka You'll need to specify ShouldConstrainToRootBounds="False" on that popup as well. That will allow the popup to escape the bounds of its island (e.g. the ComboBox dropdown can go outside the window bounds), and lets the SystemBackdrop render desktop acrylic.

Isn't it the default?

IFC_RETURN(m_tpPopupPart.Cast<Popup>()->put_ShouldConstrainToRootBounds(false));

Or you mean we should set it in xaml?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-ComboBox area-Materials Reveal, Acrylic, lighting, etc. area-Popup bug Something isn't working team-Controls Issue for the Controls team
Projects
None yet
Development

No branches or pull requests

4 participants