mirror of
https://github.com/electron/electron.git
synced 2026-02-10 23:25:30 -05:00
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.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user