From: Cheng Zhao Date: Sat, 26 Jul 2014 06:03:37 +0000 (+0800) Subject: views: Return restored bounds when window is minimized, fixes #473. X-Git-Tag: v0.14.3~1 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=cab00a1450d84ed9d7abb9f1d89aa45db64f969d;p=electron.git views: Return restored bounds when window is minimized, fixes #473. On Window the minimized window would have a fake bounds that is out of the screen, which is not consistent to other platforms' behavior. --- diff --git a/atom/browser/native_window_views.cc b/atom/browser/native_window_views.cc index 738a2577..b63b8ae4 100644 --- a/atom/browser/native_window_views.cc +++ b/atom/browser/native_window_views.cc @@ -204,6 +204,11 @@ void NativeWindowViews::SetSize(const gfx::Size& size) { } gfx::Size NativeWindowViews::GetSize() { +#if defined(OS_WIN) + if (IsMinimized()) + return window_->GetRestoredBounds().size(); +#endif + return window_->GetWindowBoundsInScreen().size(); } @@ -287,6 +292,11 @@ void NativeWindowViews::SetPosition(const gfx::Point& position) { } gfx::Point NativeWindowViews::GetPosition() { +#if defined(OS_WIN) + if (IsMinimized()) + return window_->GetRestoredBounds().origin(); +#endif + return window_->GetWindowBoundsInScreen().origin(); }