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

In-app acrylic brushes on MSIX apps fail #4504

Closed
xerz-one opened this issue Mar 13, 2021 · 6 comments
Closed

In-app acrylic brushes on MSIX apps fail #4504

xerz-one opened this issue Mar 13, 2021 · 6 comments
Labels
area-Materials Reveal, Acrylic, lighting, etc. product-winui3 WinUI 3 issues team-Controls Issue for the Controls team v0.5 Issues introduced in the Project Reunion 0.5 prerelease

Comments

@xerz-one
Copy link

Describe the bug
In an MSIX-packaged Win32 project, if setting an in-app acrylic brush as a fill or background property on any element with support for the properties, the project halts during execution and throws an exception like the following:

Exception thrown at 0x751BA8B2 in HelloReunion.exe: Microsoft C++ exception: winrt::hresult_error at memory location 0x0317DD40.

The output contains information like the following:

Exception thrown at 0x751BA8B2 (KernelBase.dll) in HelloReunion.exe: 0x40080202: WinRT transform error (parameters: 0x8000000B, 0x80070490, 0x00000022, 0x0317D3E4).
Exception thrown at 0x751BA8B2 (KernelBase.dll) in HelloReunion.exe: WinRT originate error - 0x80070490 : 'Windows.Graphics.Display: GetForCurrentView must be called on a thread that is associated with a CoreWindow.'.
Exception thrown at 0x751BA8B2 in HelloReunion.exe: Microsoft C++ exception: winrt::hresult_error at memory location 0x0317DD40.

Notice, specifically, the following message: GetForCurrentView must be called on a thread that is associated with a CoreWindow.. This implies there is no support for Win32 window handles, and only CoreWindows on WinRT are compatible.

Steps to reproduce the bug

  1. Create a new Visual Studio project using the "Blank App, Package (WinUI in Desktop)" template from Project Reunion
  2. Set an in-app acrylic brush (e.g. SystemControlAcrylicElementBrush) as an element's background or fill property, like in e.g. https://gist.github.com/xerz-one/b8c8a53a837ba231b6814bbe495161b7
  3. Build and run the project, load the view where the brushed element is located at

Expected behavior

The program executes with no errors and displays an element with an acrylic brush applied. This should not be an issue, since in-app acrylic brushes are now supported.

Version Info

NuGet package version:
WinUI 3 - Project Reunion 0.5 Preview: 0.5.0-prerelease

Windows app type:

UWP Win32
No Yes
Windows 10 version Saw the problem?
Insider Build (xxxxx)
October 2020 Update (19042) Yes
May 2020 Update (19041)
November 2019 Update (18363)
May 2019 Update (18362)
October 2018 Update (17763)
April 2018 Update (17134)
Fall Creators Update (16299)
Creators Update (15063)
@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Mar 13, 2021
@xerz-one
Copy link
Author

This is related to issue #4496, a new ticket was opened after it was requested on #4480 (comment)

@Noemata
Copy link

Noemata commented Mar 13, 2021

If you turn off C++ exceptions as shown here, your app will continue to run: #4510

Regardless, such exceptions should not be leaking into a managed app and will have a significant drag on performance under the hood. Microsoft needs a better test suite.

@xerz-one
Copy link
Author

Yes, it will still run if you skip/disable the exception. But it will run without the brush applied - so, no support, unlike currently claimed.

I personally don't know how C++ exceptions should be handled in managed apps, but I understand this one has a legitimate reason to be thrown.

@StephenLPeters StephenLPeters added area-Materials Reveal, Acrylic, lighting, etc. v0.5 Issues introduced in the Project Reunion 0.5 prerelease team-Controls Issue for the Controls team product-winui3 WinUI 3 issues labels Mar 19, 2021
@StephenLPeters
Copy link
Contributor

@pratikone FYI

@StephenLPeters StephenLPeters removed the needs-triage Issue needs to be triaged by the area owners label Mar 19, 2021
@pratikone
Copy link
Contributor

pratikone commented Mar 19, 2021

Yeah, I am aware of this noisy warning. It is not related to acrylic directly. Acrylic calls certain apis which only make sense in UWP apps (CoreWindow based) and not Desktop apps (no CoreWindow concept) and thus this warning appears. It is being tracked internally and will be removed in future releases. It is an harmless exception and can be ignored for now.
#4496 though has the same premise, it is a different bug where acrylic is not rendering at all. I am tracking that too.

@xerz-one
Copy link
Author

@pratikone Isn't that the same issue though? Here, once skipping the thrown exceptions, the acrylic still doesn't render.

Regardless, as stated, I opened up the ticket as it was requested, already acknowledging #4496. I understand if it's best to work over there.

@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Mar 19, 2021
@StephenLPeters StephenLPeters removed the needs-triage Issue needs to be triaged by the area owners label Mar 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Materials Reveal, Acrylic, lighting, etc. product-winui3 WinUI 3 issues team-Controls Issue for the Controls team v0.5 Issues introduced in the Project Reunion 0.5 prerelease
Projects
None yet
Development

No branches or pull requests

4 participants