Page 1 of 1

Black screen appears when the browser loads for the 1st time

PostPosted: Fri Mar 12, 2021 9:38 am
by Dhvaj17
Hi,

CEF Sharp - V86

I am getting this strange issue and our users have starting complaining about it.

When the cefsharp winform browser loads for the first time, it shows the black window for few mili-seconds and then it disappears.
If we reload or refresh the webpage, it does not happens.

We have recently upgraded from V79 to V86 and we did not had any issue in earlier version.

What i have tried so far is, tried setting below command line arguements but it didn't work.

settings.CefCommandLineArgs.Add("disable-gpu");
settings.CefCommandLineArgs.Add("disable-gpu-compositing");

I have also tried setting
Cef.EnableHighDPISupport()

But it didn't work.

Any help or lead will be appreciated.

Re: Black screen appears when the browser loads for the 1st

PostPosted: Fri Mar 12, 2021 5:16 pm
by amaitland
Continue discussion at viewtopic.php?f=6&t=11526

Re: Black screen appears when the browser loads for the 1st

PostPosted: Mon Mar 15, 2021 3:29 am
by Dhvaj17
amaitland wrote:Continue discussion at viewtopic.php?f=6&t=11526


Issue is happening in latest CEF Version i.e V88.

Checked with CEFSharp Minimal Example kept here
https://github.com/cefsharp/CefSharp.MinimalExample

When we load CefSharp winform browser in wpf application using winform host, a black screen appears on load for the first time for few miliseconds and then disappears.

This was not happening in earlier version.(i checked with V79).

Steps to reproduce.
1. Create a sample wpf application ,use windowsformhost to load cefsharp winform browser.
2. In constructor of winform browser, use any url. I tested with www.googlecom.
3. Run the application.
3. Notice the initial black screen appears for few miliseconds and then disappears and loads the url.

Please note this happens only for the first time when the chrome winform loads and later any url loaded into it works fine.

Can anyone please suggest or help

Re: Black screen appears when the browser loads for the 1st

PostPosted: Mon Mar 15, 2021 5:11 am
by Dhvaj17
This is working fine till v83.
From v84 - [84.0.4147.105], this seems to be broken and issue is also reproducible in latest V88.

Re: Black screen appears when the browser loads for the 1st

PostPosted: Mon Mar 15, 2021 5:38 am
by amaitland
Does the problem reproduce with the WinForms example?

You can also test with https://github.com/cefsharp/CefSharp.Wpf.HwndHost

As this doesn't appear to be a CefSharp specific issue using the other topic would be preferable.

Re: Black screen appears when the browser loads for the 1st

PostPosted: Tue Mar 16, 2021 2:50 am
by Dhvaj17
amaitland wrote:Does the problem reproduce with the WinForms example?

You can also test with https://github.com/cefsharp/CefSharp.Wpf.HwndHost

As this doesn't appear to be a CefSharp specific issue using the other topic would be preferable.



It works fine with winform example. It is only a problem with a cross browser(i mean using chrome winform browser in WPFApplication via WindowsFormHost Control)

Sample code:

MainWindow.xaml

<Border Grid.Row="1" BorderThickness="0,1">
<WindowsFormsHost Name="Host">
</WindowsFormsHost>
</Border>

MainWindow.xaml.cs

public partial class MainWindow : Window
{
public MainWindow()
{
var Browser = new CefSharp.WinForms.ChromiumWebBrowser("www.google.com");
InitializeComponent();
Host.Child = Browser;
}
}

Re: Black screen appears when the browser loads for the 1st

PostPosted: Tue Mar 16, 2021 3:46 am
by amaitland

Re: Black screen appears when the browser loads for the 1st

PostPosted: Tue Mar 16, 2021 4:34 am
by Dhvaj17
amaitland wrote:Did you test with https://github.com/cefsharp/CefSharp.Wpf.HwndHost


I am same seeing the same issue happening with the above mentioned app.

A black screen appears for few mili-seconds and then disappears once the content loads.

Re: Black screen appears when the browser loads for the 1st

PostPosted: Tue Mar 16, 2021 4:50 am
by amaitland
Based on that I think it's likely a chromium change that's causing this.

You can take the last working branch and upgrade it to a newer version of CEF, that should exclude any CefSharp specific changes.