Fullscreen issue on youtube with branch 4324

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.

Fullscreen issue on youtube with branch 4324

Postby edgardog » Tue Feb 23, 2021 8:37 am

Hello,
I'm using latest branch 4324 and I'm getting this weird issue on youtube. When you press the full screen button it goes into full screen but only to the limits of my container window. I have cef running inside a java app and on the previous branch I had (branch 4183) It would got to the computer full screen when you hit full screen. Now its limited to the confines of the window.
Something similar happens on cef client, but I have never used it on cefclient so it might have been always the way it used to work.. when you hit fullscreen on cefclient it maximizes the window to cover all screen but it keeps the URL navigation bar (its not really full screen, its just a maximized window).

I have not changed the code for this in years, so I'm not sure there is a new wall to call full screen. Here is the code I call when I get the full screen trigger:
Code: Select all
void GtkDelegate::EnterFullscreen(CefRefPtr<CefBrowser> browser) {
    ::Display* xdisplay = cef_get_xdisplay();
    ::Window x_root_window = DefaultRootWindow(xdisplay);

    XWindowAttributes attr;
    XGetWindowAttributes(xdisplay, x_root_window, &attr);

    // Create new fullscreen parent window for the browser
    XSetWindowAttributes swa;
    memset(&swa, 0, sizeof (swa));
    swa.background_pixmap = None;
    swa.override_redirect = true;
    m_FullscreenParent = XCreateWindow(
            xdisplay, x_root_window,
            0, 0, attr.width, attr.height,
            0, // border width
            CopyFromParent, // depth
            InputOutput,
            CopyFromParent, // visual
            CWBackPixmap | CWOverrideRedirect,
            &swa);

    Atom wmState = ::XInternAtom(xdisplay, "_NET_WM_STATE", False);
    Atom wmFullscreen = ::XInternAtom(xdisplay, "_NET_WM_STATE_FULLSCREEN", False);

    XEvent xclient;
    memset(&xclient, 0, sizeof (xclient));
    xclient.type = ClientMessage;
    xclient.xclient.window = m_FullscreenParent;
    xclient.xclient.message_type = wmState;
    xclient.xclient.format = 32;
    xclient.xclient.data.l[0] = 1;
    xclient.xclient.data.l[1] = wmFullscreen;
    xclient.xclient.data.l[2] = None;

    XSendEvent(xdisplay, x_root_window, False,
            SubstructureRedirectMask | SubstructureNotifyMask,
            &xclient);

    // Reparent the browser to fullscreen parent
    ::Window xwindow = browser->GetHost()->GetWindowHandle();
    XReparentWindow(xdisplay, xwindow, m_FullscreenParent, 0, 0);

    // Resize the browser to fullscreen size
    XWindowChanges changes = {0};
    changes.width = attr.width;
    changes.height = attr.height;
    XConfigureWindow(xdisplay, xwindow, CWHeight | CWWidth, &changes);

    XMapWindow(xdisplay, m_FullscreenParent);
}


I would appreciate any inputs if this is a new thing and I need to change the code.. I'm still troubleshooting it, checking which sites behave like this or if this is only limited to youtube.. but I wanted to post a question here in case its something I missed on a recent change.
I actually like to have this as an option, to control how big full screen can go, but for the time being I need to be able to go full screen on all screen.

Best Regards
edgardog
Expert
 
Posts: 111
Joined: Mon Feb 01, 2016 2:05 pm

Re: Fullscreen issue on youtube with branch 4324

Postby magreenblatt » Tue Feb 23, 2021 10:53 am

I suggest stepping through your code with a debugger to verify that it's executing with the parameters that you expect.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Fullscreen issue on youtube with branch 4324

Postby edgardog » Tue Feb 23, 2021 2:38 pm

Thanks for the suggestion.
It looks like a timming issue. I tried on different computers and on some it works correctly half of the time (usually 1920x1080) and others (1366x768) its more prone to fail.
I will setup the debugger.
It is weird that on a previous branch it had no issues at all, but maybe the issue was there and it was just less prone to trigger on the older branch.

Best Regards!
edgardog
Expert
 
Posts: 111
Joined: Mon Feb 01, 2016 2:05 pm

Re: Fullscreen issue on youtube with branch 4324

Postby magreenblatt » Tue Feb 23, 2021 5:38 pm

It might help if you add XFlush(xdisplay) (see this possibly related thread).
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Fullscreen issue on youtube with branch 4324

Postby edgardog » Mon Mar 01, 2021 7:26 am

Thanks, that seem to do the trick.
I quickly tested it and seems to work, I will put it through QA so we test on several computer models and will report later on, but so far so good!.
edgardog
Expert
 
Posts: 111
Joined: Mon Feb 01, 2016 2:05 pm


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 88 guests