SetFullScreen should not work at all when not fullscreenable

This follows the logic of OS X.
This commit is contained in:
Cheng Zhao 2016-03-05 21:38:06 +09:00
parent f5d79677fa
commit 2be368bded

View file

@ -363,29 +363,27 @@ bool NativeWindowViews::IsMinimized() {
}
void NativeWindowViews::SetFullScreen(bool fullscreen) {
if (!IsFullScreenable())
return;
#if defined(OS_WIN)
// There is no native fullscreen state on Windows.
if (fullscreen) {
if (IsFullScreenable()) {
last_window_state_ = ui::SHOW_STATE_FULLSCREEN;
NotifyWindowEnterFullScreen();
}
last_window_state_ = ui::SHOW_STATE_FULLSCREEN;
NotifyWindowEnterFullScreen();
} else {
last_window_state_ = ui::SHOW_STATE_NORMAL;
NotifyWindowLeaveFullScreen();
}
// We set the new value after notifying, so we can handle the size event
// correctly.
if (IsFullScreenable())
window_->SetFullscreen(fullscreen);
window_->SetFullscreen(fullscreen);
#else
if (!fullscreen || (fullscreen && IsFullScreenable())) {
if (IsVisible())
window_->SetFullscreen(fullscreen);
else
window_->native_widget_private()->ShowWithWindowState(
ui::SHOW_STATE_FULLSCREEN);
}
if (IsVisible())
window_->SetFullscreen(fullscreen);
else
window_->native_widget_private()->ShowWithWindowState(
ui::SHOW_STATE_FULLSCREEN);
#endif
}