MouseLock and Fullscreen support

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.

MouseLock and Fullscreen support

Postby kavadog » Fri Jan 15, 2016 6:47 pm

We are developing a CEF-based shell app that loads an application containing a PPAPI plugin and some Javascript UI. The PPAPI plugin makes use of pp::MouseLock class/API, and the Javascript uses document.webkitRequestFullscreen(). These APIs work fine when our PPAPI plugin is loaded into a chrome browser, but do not work when loaded into our CEF shell.

The PPAPI pp::MouseLock::LockMouse takes a callback as an argument that is supposed to be called when the LockMouse operation either succeeds or fails. However, this callback is never executed.

document.webkitFullscreen() seems to do nothing, although the variable document.webkitIsFullScreen seems to track the supposed state correctly.

Are there some callbacks or other configuration APIs that our CEF shell application needs to handle to allow the above calls to succeed?

Thanks.
kavadog
Techie
 
Posts: 28
Joined: Mon Jul 27, 2015 5:46 pm

Re: MouseLock and Fullscreen support

Postby magreenblatt » Fri Jan 15, 2016 9:41 pm

What OS and CEF version? Fullscreen should all CefDisplayHandler::OnFullscreenModeChange in 2454 branch and newer. MouseLock likely isn't implemented in CEF (feel free to file a bug -- patches welcome).
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: MouseLock and Fullscreen support

Postby kavadog » Tue Jan 19, 2016 7:39 pm

CEF 2526 and Windows. Yes, I got Fullscreen mode working well now. Thanks for the tip.

Regarding MouseLock, do you have any hints/tips for where to begin on Mouse/Pointer Lock? It looks this this is handled through a renderview or something class, but I’m not quite sure where to start without more digging around more in the CEF/Chromium sources. I'm happy to provide a patch back to you once I get this added. Any additional pointers you may have would be great.
kavadog
Techie
 
Posts: 28
Joined: Mon Jul 27, 2015 5:46 pm

Re: MouseLock and Fullscreen support

Postby magreenblatt » Tue Jan 19, 2016 8:24 pm

The WebContentsDelegate RequestToLockMouse and LostMouseLock methods will need to be implemented in CefBrowserHostImpl. You can compare to the implementation in chrome/browser/ui/browser.cc but it won't be a 1:1 code copy.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 107 guests