cefsharp/CefSharp

Multiple Renders/paint events processed at the same time

joriverm opened this issue · 3 comments

Is there an existing issue for this?

  • I have searched both open/closed issues, no issue already exists.

CefSharp Version

131.2.7

Operating System

Windows 10

Architecture

x64

.Net Version

.net 8

Implementation

WPF

Reproduction Steps

the supplied code is a repo based on the blazor webview i made together with jpmikkers. its different, but similar to his version @ https://github.com/jpmikkers/Baksteen.Blazor.CefSharp.

when using the WPF example and going to the counter page, and typing a random large text quickly into the first textbox you can get a render batch exception.
CefSharp.BlazorWebview.zip

image

Expected behavior

no exception being thrown by blazor

Actual behavior

blazor throwing render batch exception because it is getting a render complete message before the render is actually done.

Regression?

No response

Known Workarounds

N/A

Does this problem also occur in the CEF Sample Application

Not Tested

Other information

what is actually happening, from what i can understand and figured is that 2 renders are triggered in quick succession, or simultaneously, and the second render is faster than the first. this results in blazor getting a render complete message from the second render before the first render and it throwing an exception and no longer working.

it looks like CEF(sharp) is doing the 2 renders at the same time which it shouldn't do.
or it is somehow ditching one render, saying its complete, before it did anything at all.
any information of help is very much appreciated because i have no idea how to fix this...

the supplied code is a repo based on the blazor webview i made together with jpmikkers. its different, but similar to his version @ https://github.com/jpmikkers/Baksteen.Blazor.CefSharp.

Does it reproduce with this version?

when using the WPF example and going to the counter page, and typing a random large text quickly into the first textbox you can get a render batch exception.
CefSharp.BlazorWebview.zip

I don't review code as zip files

it looks like CEF(sharp) is doing the 2 renders at the same time which it shouldn't do.
or it is somehow ditching one render, saying its complete, before it did anything at all.
any information of help is very much appreciated because i have no idea how to fix this...

CefSharp doesn't do the actual rendering, that's at the CEF/Chromium level. The errors look specific to Blazor, not something I'm familiar with.

How does it behave with the CefSharp.Wpf.HwndHost implementation? You should be able to swap that in easily.

If that works then you'll need to find a way to test with the CEF Sample Application(cefclient) .

Hi @amaitland !
thanks for responding!

the problem im having is reproducable with what i have sent in the zip, which is the source of the blazor hybrid webview we are using that is based on the Baksteen.Blazor.CefSharp package.
you can reproduce it by starting the WPF example and quickly typing random junk in the first input field on the counter page.

im sorry you feel like not reviewing zip files, but i had to send it as a zip file as it is hosted on a private git with my client so this is the best i can do for now, unless you want me to start a private repo that i can delete afterwards?

to give a complete picture, incase i wasnt clear before, is that these packages allow blazor hybrid to work inside CEF(Sharp) and run natively instead of a full website inside WPF. it does this by starting the webview version of blazor.
Its true the error comes from blazor itself, and is an indication the render events have been processed out of order.
this doesnt happen in the official webview, but does happen in CEF. ive tried to dig as deep as i could, but im not knowledged enough to know if there is anything i can do using CEF(Sharp) to know what is happening exactly, what i can do, or if it does something with the render events that would cause it to let blazor know a render has completed (which is an IPC message passed through JS) before the previous render was done...

because of the nature of the code (a whole webview manager build on top of the CEF webview) i dont know if its that easy to reproduce in the sample applications without porting that to the project. do you want me to try that?