mirror of
https://github.com/Stone-Red-Code/DesktopMagic.git
synced 2026-09-04 08:56:15 +02:00
Fix WebView2 interaction on transparent window with opaque rectangle
This commit is contained in:
@@ -21,8 +21,9 @@
|
||||
|
||||
<Border x:Name="border" Background="Transparent" CornerRadius="10">
|
||||
<Grid>
|
||||
<wv2:WebView2 x:Name="webView" DefaultBackgroundColor="Transparent" CoreWebView2InitializationCompleted="webView_CoreWebView2InitializationCompleted" />
|
||||
<Rectangle Fill="Transparent" IsHitTestVisible="True" />
|
||||
<wv2:WebView2 x:Name="webView" DefaultBackgroundColor="Transparent" CoreWebView2InitializationCompleted="WebView_CoreWebView2InitializationCompleted" />
|
||||
<!-- WORKAROUND: This rectangle exists to allow interaction with the WebView2 when the window is transparent -->
|
||||
<Rectangle Fill="#01000000" />
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
@@ -230,7 +230,7 @@ public partial class WebPluginWindow : Window, IPluginWindow
|
||||
tileBar.CaptionHeight = ActualHeight - 10;
|
||||
}
|
||||
|
||||
private void webView_CoreWebView2InitializationCompleted(object sender, CoreWebView2InitializationCompletedEventArgs e)
|
||||
private void WebView_CoreWebView2InitializationCompleted(object sender, CoreWebView2InitializationCompletedEventArgs e)
|
||||
{
|
||||
webView.CoreWebView2.DOMContentLoaded += (_, _) => ThemeChanged();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user