How to create a browser 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.

How to create a browser in fullscreen mode

Postby mjshi » Fri Dec 17, 2021 11:13 pm

edit: better phrasing
Is there a way to launch a window in fullscreen using code, i.e., using CreateBrowser to create a fullscreen window?
My CEF application isn't using views, so would I have to use X11 (on Linux) to make the windows fullscreen?

---
original post:
Is there an easy way to get all browser windows and fullscreen them using code, as a response to a frontend window.cefQuery request?
I've tried using SetFullscreen from cef_window.h in my query processor, on a UI thread, but it doesn't seem to work. There also doesn't seem to be a good way to retrieve pointers to all the browsers that are currently open, within the query processor.

This is the code I'm trying to use to fullscreen things:
Code: Select all
const CefRefPtr<CefBrowserView> browser_view = CefBrowserView::GetForBrowser(browser);
if (browser_view) {
    CefRefPtr<CefWindow> window = browser_view->GetWindow();
    if (window) {
        window->SetFullscreen(true);
    }
}

I also found this topic: https://magpcss.org/ceforum/viewtopic.p ... 706#p21198
but it's a lot older and I didn't have much success with borderless window mode.
mjshi
Newbie
 
Posts: 5
Joined: Tue Aug 24, 2021 10:17 am

Return to Support Forum

Who is online

Users browsing this forum: No registered users and 41 guests