microsoft / microsoft-ui-xaml

Windows UI Library: the latest Windows 10 native controls and Fluent styles for your applications
MIT License
6.34k stars 677 forks source link

AcrylicInAppFillColorDefaultBrush does not work when above WebView2 #8267

Closed moshegutman closed 8 months ago

moshegutman commented 1 year ago

Describe the bug

The in app acrylic brush does not blur anything from a WebView2 placed below it.

Steps to reproduce the bug

Simple repro:

<?xml version="1.0" encoding="utf-8"?>
<Window
    x:Class="App1.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:App1"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="200"/>
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <WebView2 Grid.ColumnSpan="2" Source="https://coolors.co/" />

        <!--<Rectangle Width="100" Height="100" Fill="Red" HorizontalAlignment="Left" />-->

        <ListView Background="{StaticResource AcrylicInAppFillColorDefaultBrush}">
            <ListViewItem>test</ListViewItem>
            <ListViewItem>test</ListViewItem>
            <ListViewItem>test</ListViewItem>
            <ListViewItem>test</ListViewItem>
            <ListViewItem>test</ListViewItem>
            <ListViewItem>test</ListViewItem>
            <ListViewItem>test</ListViewItem>
            <ListViewItem>test</ListViewItem>
            <ListViewItem>test</ListViewItem>
            <ListViewItem>test</ListViewItem>
        </ListView>

    </Grid>
</Window>

Expected behavior

I expected the browser content to be blurred along with any other control.

Screenshots

Screenshot 2023-03-09 155010

NuGet package version

WinUI 3 - Windows App SDK 1.3 Experimental 1: 1.3.230202101-experimental1

Windows version

Windows 11 (22H2): Build 22621

Additional context

No response

sotanakamura commented 1 year ago

8130 WebView requires special rendering, and combining it with other controls may cause rendering problems. Please consider using alternative layouts until WebView is updated.

ranjeshj commented 1 year ago

This is by design. Acrylic does not work above swapchain panel or webview2. This should be documented. Tagging as doc bug.

DmitriyKomin commented 8 months ago

This is by design. Acrylic does not work above swapchain panel or webview2. This should be documented. Tagging as doc bug.

Documentation explaining the limitations of WinAppSDK rendering of external swapchain content (including MediaPlayerElement, SwapchainPanel, WebView2, and Mica/DesktopAcrylicBackdrop) has been added at Differences from UWP.