OutSystems / CefGlue

.NET binding for The Chromium Embedded Framework (CEF)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Avalonia Control Rendering Issue(s)

cfnfy opened this issue · comments

commented

AvaloniaCefBrowser is currently not rendering in way that allows for it to be treated like other controls. It is always showing above other Controls (not respecting ZIndex) and will render in full outside the bounds that the control occupies.

An example of this issue is having a Grid with a header row and a ScrollViewer in a separate row. When this ScrollViewer is moved to a position where the AvaloniaCefBrowser should be out of view or cut due to the bounds on the grid row, it instead shows over the header row. This is not the case for other controls.

A straightforward way to demonstrate this issue is to overlay a panel/border on top of the AvaloniaCefBrowser. It will always be hidden by the AvaloniaCefBrowser. The only way I have found to render a control on top of an AvaloniaCefBrower is to use a flyout/popout.

Another way to demonstrate this issue is to wrap the AvaloniaCefBrowser with a Border with ClipToBounds set to true and reduce the size of the border to less than the control, or to introduce a corner radius that would cut parts of the corners. These changes will not impact the AvaloniaCefBrowser as they would any other control.

This issue currently limits use of the AvaloniaCefBrowser to being static position within a window.

Another issue, which may be related is that when scrolling a view with an AvaloniaCefBrowser, it doesn't move in sync with other controls. Interestingly it moves ahead of other controls.

I'm going to take a look through the repo to better understand this, but wanted to flag it first incase others can provide comments/guidance.

  • OSX (ARM64)
  • Avalonia 11.0.0 & 11.0.2
  • CefGlue.Avalonia 106.5249.19-avalonia11

Hi,

What you're describing is not an issue but rather a known limitation of CEF/Avalonia/WPF playing together, commonly called "airspace problem" (https://learn.microsoft.com/en-us/dotnet/desktop/wpf/advanced/technology-regions-overview?view=netframeworkdesktop-4.8).

To overcome that you have the option of using the off-screen rendering mode (https://github.com/OutSystems/CefGlue/blob/main/CefGlue.Demo.Avalonia/Program.cs#L20), but be aware that might introduce other issues and usually is worse performance wise.

commented

@joaompneves thank you for coming back on this so quickly, and providing such a clear response. I will mark this as closed.