From cab00a1450d84ed9d7abb9f1d89aa45db64f969d Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sat, 26 Jul 2014 14:03:37 +0800 Subject: [PATCH] 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. --- atom/browser/native_window_views.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/atom/browser/native_window_views.cc b/atom/browser/native_window_views.cc index 738a257783..b63b8ae463 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(); }