Stop rendering process

Having problems with building or using the CefSharp .NET binding? Ask your CEF-related questions here. Please ask general usage questions on StackOverflow.

Moderator: amaitland

Stop rendering process

Postby ValentinNikin » Wed Jul 07, 2021 11:34 am

I need to stop rendering process (OnPaint method mustn't fired), and start that process again after a while. Can I do it?

In that time, while rendering process is stopped I need to change some settings such as Window Size, Frame Rate, URL. Seems I can change it with ChromiumWebBrowser instance.

But also I need to change GPU renderer settings (enable/disable). Is it possible?
ValentinNikin
Techie
 
Posts: 34
Joined: Fri Jun 18, 2021 1:37 am

Re: Stop rendering process

Postby amaitland » Wed Jul 07, 2021 2:03 pm

GPU settings are process wide, cannot be changed after set, you'll need to restart your application.

There is no option I'm aware of to close a render process.
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1290
Joined: Wed Jan 14, 2015 2:35 am

Re: Stop rendering process

Postby magreenblatt » Wed Jul 07, 2021 2:14 pm

You can stop the OnPaint callback with WasHidden(true) but it won’t terminate or restart any processes.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Stop rendering process

Postby amaitland » Wed Jul 07, 2021 2:24 pm

You can control some of the low level functionality including frame rate via the IBrowserHost interface.

http://cefsharp.github.io/api/91.1.x/ht ... erHost.htm
http://cefsharp.github.io/api/91.1.x/ht ... erHost.htm
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1290
Joined: Wed Jan 14, 2015 2:35 am

Re: Stop rendering process

Postby ValentinNikin » Wed Jul 07, 2021 2:50 pm

I tried call .Dispose() for ChromiumWebBrowser instance when I need stop the process. And seems it's work for me. When I need to start again I create new ChromiumWebBrowser instance. What you say about this approach?
But I ran into another problem, when I call Cef.Shutdown, the application process is exited with code 0x80000003.
ValentinNikin
Techie
 
Posts: 34
Joined: Fri Jun 18, 2021 1:37 am

Re: Stop rendering process

Postby amaitland » Wed Jul 07, 2021 3:53 pm

You can dispose of the ChromiumWebBrowser instance and create a new one if that suites your purpose.

All ChromiumWebBrowser instances must be disposed before calling Cef.Shutdown,. Once call you cannot create any further ChromiumWebBrowser instances. You cannot Cef.Initialize after shutdown is called.
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1290
Joined: Wed Jan 14, 2015 2:35 am


Return to CefSharp Forum

Who is online

Users browsing this forum: No registered users and 14 guests