🎨 Reuse existing function
This commit is contained in:
parent
aeb68c2369
commit
265ab45bd7
1 changed files with 3 additions and 6 deletions
|
@ -480,7 +480,7 @@ void NativeWindowViews::SetFullScreen(bool fullscreen) {
|
||||||
|
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
// There is no native fullscreen state on Windows.
|
// There is no native fullscreen state on Windows.
|
||||||
bool fullscreen_to_normal_detected = IsFullscreen() && !fullscreen;
|
bool leaving_fullscreen = IsFullscreen() && !fullscreen;
|
||||||
|
|
||||||
if (fullscreen) {
|
if (fullscreen) {
|
||||||
last_window_state_ = ui::SHOW_STATE_FULLSCREEN;
|
last_window_state_ = ui::SHOW_STATE_FULLSCREEN;
|
||||||
|
@ -512,11 +512,8 @@ void NativeWindowViews::SetFullScreen(bool fullscreen) {
|
||||||
// else a non-responsive window shell could be rendered.
|
// else a non-responsive window shell could be rendered.
|
||||||
// (this situation may arise when app starts with fullscreen: true)
|
// (this situation may arise when app starts with fullscreen: true)
|
||||||
// Note: the following must be after "window_->SetFullscreen(fullscreen);"
|
// Note: the following must be after "window_->SetFullscreen(fullscreen);"
|
||||||
if (fullscreen_to_normal_detected && !IsVisible()) {
|
if (leaving_fullscreen && !IsVisible())
|
||||||
LONG frame_style = ::GetWindowLong(GetAcceleratedWidget(), GWL_STYLE);
|
FlipWindowStyle(GetAcceleratedWidget(), true, WS_VISIBLE);
|
||||||
frame_style |= WS_VISIBLE;
|
|
||||||
::SetWindowLong(GetAcceleratedWidget(), GWL_STYLE, frame_style);
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
if (IsVisible())
|
if (IsVisible())
|
||||||
window_->SetFullscreen(fullscreen);
|
window_->SetFullscreen(fullscreen);
|
||||||
|
|
Loading…
Add table
Reference in a new issue