exit HTML fullscreen when window leaves fullscreen (#13090)

This commit is contained in:
Milan Burda 2018-06-18 09:48:20 +02:00 committed by Cheng Zhao
parent 28fd571d0c
commit 2eb5b751f3
3 changed files with 32 additions and 0 deletions

View file

@ -270,6 +270,14 @@ void BrowserWindow::OnWindowResize() {
TopLevelWindow::OnWindowResize();
}
void BrowserWindow::OnWindowLeaveFullScreen() {
TopLevelWindow::OnWindowLeaveFullScreen();
#if defined(OS_MACOSX)
if (web_contents()->IsFullscreenForCurrentTab())
web_contents()->ExitFullscreen(true);
#endif
}
void BrowserWindow::Focus() {
if (api_web_contents_->IsOffScreen())
FocusOnWebView();