Launching Cef in fullscreen mode

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.

Launching Cef in fullscreen mode

Postby sburke » Fri Jun 16, 2017 4:45 pm

According to http://peter.sh/experiments/chromium-co ... -switches/, the command-line switch to launch Cef in fullscreen mode should be --start-fullscreen. However, I can't find this switch anywhere in the Cef source code. I have tried launching as follows:

Code: Select all
cefclient.exe --url=www.google.com --start-fullscreen
cefclient.exe --url=www.google.com --start-fullscreen=1
cefclient.exe --url=www.google.com --start-fullscreen=true


None of these are working. Is there another argument I can pass in?
sburke
Mentor
 
Posts: 54
Joined: Tue May 30, 2017 1:17 pm

Re: Launching Cef in fullscreen mode

Postby Czarek » Fri Jun 16, 2017 11:20 pm

CEF doesn't support that switch. Many of the switches listed on peter.sh are Google Chrome only switches.
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: Launching Cef in fullscreen mode

Postby sburke » Mon Jun 19, 2017 9:50 am

So is there no way to launch Cef3 in full screen? Does hiding the toolbar and what-not require that the actual Cef3 source code be updated?
sburke
Mentor
 
Posts: 54
Joined: Tue May 30, 2017 1:17 pm

Re: Launching Cef in fullscreen mode

Postby magreenblatt » Mon Jun 19, 2017 9:52 am

You can implement full screen mode in your client application code.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Launching Cef in fullscreen mode

Postby sburke » Mon Jun 19, 2017 10:02 am

By "client application code", are you referring to the actual Chromium open source code? All of Chromium is "client application code", so I presume that's what you mean. The bottom line is, there's no switch or environment variable that will cause Chromium to launch in full screen mode. It must be implemented programmatically by editing the actual browser source code, correct?
sburke
Mentor
 
Posts: 54
Joined: Tue May 30, 2017 1:17 pm

Re: Launching Cef in fullscreen mode

Postby HarmlessDave » Mon Jun 19, 2017 11:20 am

I can't share the source code from work, but for Windows and OS X we replaced the window creation code in our version of CEFClient (the application level), we did not need to change anything in the CEF3 library or in Chromium.
HarmlessDave
Expert
 
Posts: 370
Joined: Fri Jul 11, 2014 2:02 pm

Re: Launching Cef in fullscreen mode

Postby sburke » Tue Jun 20, 2017 2:00 pm

Are you able to say which files were modified? The only references to the toolbar or full screen that I've found thus are are in browser_info_manager.cc and cef_types_wrappers.h, which I have modified as follows:

browser_info_manager.cc:
Code: Select all
features.menuBarVisible = false;
features.statusBarVisible = false;
features.toolBarVisible = false;
features.locationBarVisible = false;
features.scrollbarsVisible = false;
features.resizable = false;


cef_types_wrappers.h:
Code: Select all
s->menuBarVisible = false;
s->statusBarVisible = false;
s->toolBarVisible = false;
s->locationBarVisible = false;
s->scrollbarsVisible = false;
s->resizable = false;

target->menuBarVisible = false;
target->statusBarVisible = false;
target->toolBarVisible = false;
target->locationBarVisible = false;
target->scrollbarsVisible = false;
target->resizable = false;
target->fullscreen = true;


Compile (4+ hours), relaunch...no change.

Thanks for responding.
sburke
Mentor
 
Posts: 54
Joined: Tue May 30, 2017 1:17 pm

Re: Launching Cef in fullscreen mode

Postby HarmlessDave » Tue Jun 20, 2017 3:31 pm

No rebuilding of libcef.dll should be needed, at least for a C++ application.

We first copied the CEFClient source in 2272 and it has changed a lot since then. In 2924 I see RootWindowWin::CreateRootWindow in root_window_win.cc for the Windows root window creation. You'd need to poke around in CEFClient for other OSs. At least for Windows you could also let the default creation happen and then just change the window styles.
HarmlessDave
Expert
 
Posts: 370
Joined: Fri Jul 11, 2014 2:02 pm

Re: Launching Cef in fullscreen mode

Postby salvadordf » Wed Jun 21, 2017 2:52 am

sburke : You have to do something like this :
https://www.codeproject.com/Questions/1 ... l-Screen-C
You don't have to modify CEF3 libraries.
Maintainer of the CEF4Delphi, WebView4Delphi, WebUI4Delphi and WebUI4CSharp projects.
User avatar
salvadordf
Expert
 
Posts: 129
Joined: Sun Dec 18, 2016 8:39 am
Location: Spain

Re: Launching Cef in fullscreen mode

Postby sburke » Wed Jun 21, 2017 10:15 am

Setting the browser to the full dimensions of the screen is not a problem. I can do that. The issue is that the titlebar remains and dialog frame remain visible. I need for Chromium to go full screen just as if a user pressed F11 in Chrome.
sburke
Mentor
 
Posts: 54
Joined: Tue May 30, 2017 1:17 pm

Next

Return to Support Forum

Who is online

Users browsing this forum: Devyre, Google [Bot] and 76 guests