Black screen on browser launch before the web page opens

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Black screen on browser launch before the web page opens

Postby SusmithaK » Tue Feb 25, 2014 1:23 pm

Hi Marshal,

In some machines, when the CEF browser is launched for the first time in our application, a black screen appears for a second and then turns white and finally the webpage opens. But on subsequent launches of the browser, we do not see this black screen. The browser screen will be just white till the web page launches.

So, this black screen is seen every time we re-launch our application and open the CEF browser for the first time. Any idea why this can happen as this is happening consistently only on some machines?

Thanks,
Susmitha
SusmithaK
Techie
 
Posts: 14
Joined: Thu Dec 12, 2013 5:13 am

Re: Black screen on browser launch before the web page opens

Postby magreenblatt » Wed Feb 26, 2014 2:24 am

What OS and CEF3 version? Are you using windowed or off-screen rendering? Does the problem reproduce in cefclient?
magreenblatt
Site Admin
 
Posts: 12404
Joined: Fri May 29, 2009 6:57 pm

Re: Black screen on browser launch before the web page opens

Postby SusmithaK » Wed Feb 26, 2014 12:58 pm

We observed the issue on some Win7 and Win8 machines. We are using cef_binary_3.1650.1544_windows32 version. We are not using off screen rendering and the problem is not seen in cefclient sample. This problem is only seen in our application when the browser is launched for the first time. On opening the browser, first a white screen flashes, then turns completely black and then white again till the page loads. Not sure why this is only seen consistently in few machines. Can you please suggest how to solve this?
SusmithaK
Techie
 
Posts: 14
Joined: Thu Dec 12, 2013 5:13 am

Re: Black screen on browser launch before the web page opens

Postby Czarek » Tue Apr 15, 2014 10:25 am

I've had a similar problem of black screen reported by one of users and the solution that worked for him was to add the --disable-gpu command line switch.
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: Black screen on browser launch before the web page opens

Postby giridharb54 » Thu Apr 17, 2014 4:24 pm

HI Czarek,

I am trying to follow the method you suggested to solve the black screen issue.Below is the code to launch a seperate executable.
Code: Select all
Util::String qbcefsubprocessPathWithFileName = GetStartupDir();
   qbcefsubprocessPathWithFileName  += _T("qbcefsubprocess");
   client_handler->SetMainHwnd(m_hWndBrowser);
    CefString(&appSettings.browser_subprocess_path).FromASCII(qbcefsubprocessPathWithFileName);   
   // Initialize CEF in the main process.
    CefInitialize(main_args,appSettings, cefApplication.get());
    //GetClientRect(m_hWndBrowser, &rect);
    info.SetAsChild(m_hWndBrowser, m_rec);

How do I add the --disable-gpu command line switch? Please let me know. If we disable the gpu for cef, some of the websites which uses WebGL wont work isnt it?
giridharb54
Expert
 
Posts: 100
Joined: Thu Oct 17, 2013 2:15 am

Re: Black screen on browser launch before the web page opens

Postby Czarek » Thu Apr 17, 2014 4:37 pm

You can append command line switches programmatically in CefApp::OnBeforeCommandLineProcessing and BrowserProcessHandler::OnBeforeChildProcessLaunch. Switch name should not contain "--" when setting using CefCommandLine.
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: Black screen on browser launch before the web page opens

Postby giridharb54 » Fri Apr 18, 2014 6:25 am

Hi Czerk,

I did the changes as you suggested. I appended coomandline switches as below.
Code: Select all
void cefapplicationhandler::OnBeforeChildProcessLaunch(CefRefPtr< CefCommandLine > command_line)
{
   const CefString& name = "disable-gpu";
   command_line->AppendSwitch(name);
}

I added the switch only in OnBeforeChildProcessLaunch. The issue is still not resolved. Please let me know if I missed anything
giridharb54
Expert
 
Posts: 100
Joined: Thu Oct 17, 2013 2:15 am

Re: Black screen on browser launch before the web page opens

Postby Czarek » Fri Apr 18, 2014 8:02 am

giridharb54, Read my post again, the solution is in there.
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: Black screen on browser launch before the web page opens

Postby giridharb54 » Wed Apr 23, 2014 12:51 pm

Hi czarek,

I did as you suggested and it worked. But on loading of webgl related sites loke www.ro.me this black screen comes. How to solve this?

Regards,
Giri
giridharb54
Expert
 
Posts: 100
Joined: Thu Oct 17, 2013 2:15 am

Re: Black screen on browser launch before the web page opens

Postby Czarek » Wed Apr 23, 2014 1:30 pm

Try Google Chrome with the disable-gpu flag on the same machine and see how it behaves. If it works fine then you should use a newer version of CEF, or wait for a new release that reflects the current Google Chrome version. In my case "ro.me" displayed a message that my computer doesn't support webgl.

Another solution is to update your video card drivers to the latest version available. If you also have problems in Google Chrome with that video card drivers, then you should report it to the Chromium project.
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Next

Return to Support Forum

Who is online

Users browsing this forum: No registered users and 37 guests