SetFullScreen should not work at all when not fullscreenable
This follows the logic of OS X.
This commit is contained in:
parent
f5d79677fa
commit
2be368bded
1 changed files with 11 additions and 13 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue