From b85367113260145c1620984e555c3dbe9cde0b95 Mon Sep 17 00:00:00 2001 From: liusi Date: Thu, 15 Dec 2016 14:01:03 +0800 Subject: [PATCH] fix fullscreen, maximize, unmaximize --- atom/browser/native_window_views.cc | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/atom/browser/native_window_views.cc b/atom/browser/native_window_views.cc index 620fb7e797bf..3cdf802b9aa4 100644 --- a/atom/browser/native_window_views.cc +++ b/atom/browser/native_window_views.cc @@ -425,7 +425,7 @@ bool NativeWindowViews::IsEnabled() { void NativeWindowViews::Maximize() { #if defined(OS_WIN) // For window without WS_THICKFRAME style, we can not call Maximize(). - if (!thick_frame_) { + if (!(::GetWindowLong(GetAcceleratedWidget(), GWL_STYLE) & WS_THICKFRAME)) { restore_bounds_ = GetBounds(); auto display = display::Screen::GetScreen()->GetDisplayNearestPoint(GetPosition()); @@ -443,7 +443,7 @@ void NativeWindowViews::Maximize() { void NativeWindowViews::Unmaximize() { #if defined(OS_WIN) - if (!thick_frame_) { + if (!(::GetWindowLong(GetAcceleratedWidget(), GWL_STYLE) & WS_THICKFRAME)) { SetBounds(restore_bounds_, false); return; } @@ -486,19 +486,6 @@ void NativeWindowViews::SetFullScreen(bool fullscreen) { NotifyWindowLeaveFullScreen(); } - // For window without WS_THICKFRAME style, we can not call SetFullscreen(). - if (!thick_frame_) { - if (fullscreen) { - restore_bounds_ = GetBounds(); - auto display = - display::Screen::GetScreen()->GetDisplayNearestPoint(GetPosition()); - SetBounds(display.bounds(), false); - } else { - SetBounds(restore_bounds_, false); - } - return; - } - // We set the new value after notifying, so we can handle the size event // correctly. window_->SetFullscreen(fullscreen);