Pass-through transparency (v11) #11911
-
I tried to port some code from Windows WPF which shows partially transparent background (no chrome) window. In WPF, the allowed transparency allowed user to click within the transparent area and have the click be processed by the app in the background. e.g. behaving like the transparent background was not even part of the app. When I tried to do the same in AvaloniaUI, I did get the transparency working, on both Linux and Windows, using code below and an app.manifests which states support for Win10. But the transparent area is clearly a part of the app, on both OSes, clicking on it does nothing, and mouse hint is the one for the app, not the background (for example if you start the app in front of the editor, the mouse is an arrow until it leaves the invisible transparent section of the background, when it gets shown as an edit mouse pointer). Is there some way to achieve true functional transparency? <Window xmlns="bunch of namespaces..."
....
x:Name="LauncherWindow" x:Class="LauncherWindow"
Width="1200" Height="800"
Title="MyTestApp"
WindowStartupLocation="CenterScreen"
ShowInTaskbar="False"
SizeToContent="WidthAndHeight"
Topmost="True"
TransparencyLevelHint="Transparent"
TransparencyBackgroundFallback="Transparent"
Background="Transparent"
SystemDecorations="None"
>
<!-- does not seem to be needed in v11
ExtendClientAreaToDecorationsHint="True"
ExtendClientAreaChromeHints="NoChrome"
ExtendClientAreaTitleBarHeightHint="-1"--> |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
|
Beta Was this translation helpful? Give feedback.
-
Yea, wont work here though. On WPF, initially this was a failure because animating Width and Height of a window led to SetWindowRgn being animated, and that was so slow that animation was very very slow and choppy (didnt really waste too much time on it, but I believe it caused a repaint for every little change of the size). We solved it back then by just having a large transparent Window and a splash in the middle, and then we just animate the splash to full extent and then transition it to enabled background. Since Width and Height were not animated, it ran fast :) it was dirty but it worked. But it is what it is, Wont kill the migration initiative just because of this. We'll change the animation itself and use a large splash screen. I am more concerned by the lack of 3rd party commercial controls (and their lack of interest to make them) than by this. Thanks for your reply. |
Beta Was this translation helpful? Give feedback.
-
I found a similar scenario here where clicks manage to get through by setting a black color key with Unfortunately I couldn't make it work with Avalonia.. Am I missing something? |
Beta Was this translation helpful? Give feedback.
UpdateLayeredWindow
since it's not compatible with GPU rendering. You can try playing with SetWindowRgn