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

Unable to place any controls on top of WPF Acrylic blur #80

Closed
selastingeorge opened this issue Jan 21, 2021 · 5 comments
Closed

Unable to place any controls on top of WPF Acrylic blur #80

selastingeorge opened this issue Jan 21, 2021 · 5 comments

Comments

@selastingeorge
Copy link

I was trying to place one button over the acrylic control but the button appears to be under the control like this:

image

I have tried changing _compositorDesktopInterop.CreateDesktopWindowTarget(HwndHost, true, out _compositionTarget);

second argument to false (topmost), but it doesn't work. is this because Direct composition can draw only on top of all other controls.

@robmikh
Copy link
Member

robmikh commented Jan 21, 2021

The issue is that WPF composes all of its content into one surface. From the perspective of the system compositor, there is only one bitmap that we see. As such, we can only compose dcomp/WUC content above or bellow that bitmap. This is sometimes referred to as the "airspace problem".

If you could separate the content that is supposed to be "above" and "bellow" the visual, you could make this work. Unfortunately, I don't know off the top of my head how to achieve this in WPF.

@selastingeorge
Copy link
Author

selastingeorge commented Jan 22, 2021 via email

@selastingeorge
Copy link
Author

So there is no way to do this. In .NET 4.5 they have introduced two properties to fix this aerospace problem, but it has been removed on the next releases.

1.3.10 Windows Presentation Foundation (WPF)

1.3.10.1 HwndHost feature has been removed from WPF in the .NET Framework 4.5 Beta

The .NET Framework 4.5 Developer Preview included a WPF HwndHost redirection feature. However, this feature had several known issues and has been removed from the .NET Framework 4.5 Beta. It will not be included in any future releases.

To resolve this issue:

No workaround is available.

@robmikh
Copy link
Member

robmikh commented Jan 22, 2021

Unfortunately it looks like the only way to get this to work is to fake it. If you knew what content was to be underneath, you could manually apply the effects yourself using Win2D or D2D. However, that solution is imperfect and imposes constraints on what can be placed underneath the effect area without breaking the illusion.

@robmikh robmikh closed this as completed Jan 22, 2021
@selastingeorge
Copy link
Author

selastingeorge commented Jan 22, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants