OutSystems / CefGlue

.NET binding for The Chromium Embedded Framework (CEF)
MIT License
277 stars 41 forks source link

Cannot draw over the AvaloniaCefBrowser #181

Open sakya opened 2 weeks ago

sakya commented 2 weeks ago

It seems that is impossible to draw anything over the AvaloniaCefBrowser.

If you change the BrowserView.axaml like this

<UserControl xmlns="https://github.com/avaloniaui"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        x:Class="Xilium.CefGlue.Demo.Avalonia.BrowserView">

    <DockPanel>
        <TextBox x:Name="addressTextBox" DockPanel.Dock="Top" KeyDown="OnAddressTextBoxKeyDown" />
        <Grid>
            <Decorator x:Name="browserWrapper"/>

            <Border Width="300" Height="300" Background="Red"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center" />
        </Grid>
    </DockPanel>
</UserControl>

the border should be in front of the browser but it's not visible

OS: Windows 11

joaompneves commented 2 weeks ago

In order to be able to render anything on top, you need to enable WindowlessRendering:

https://github.com/OutSystems/CefGlue/blob/a5294071299a843bd556dd8b82243f655d78e95d/CefGlue.Demo.Avalonia/Program.cs#L27C27-L27C53

sakya commented 2 weeks ago

And what are the "more issues" in the comment that WindowlessRendering can cause? 😅

EDIT: with WindowlessRendering enabled it's impossible to write in the google search tetxbox

joaompneves commented 2 weeks ago

Seems you already found one "more issue". As stated its not recommended.

sakya commented 2 weeks ago

So it's impossible to implement JSDialogHandler without using an actual dialog window. I wanted to just render a control (with a backdrop) over the browser.

joaompneves commented 2 weeks ago

you better create an actual window