diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-14 22:40:34 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-14 22:40:34 +0000 |
commit | 5a068bd029b1d28374f0cf26cbb74bc1ef33bd0c (patch) | |
tree | 4ac3c9fae806384f0c5c1b8cc4bfd1efae7aa50a /chrome/views/window.cc | |
parent | d66cdc5623b9e6815c1048c02b6ca99664ec1bf7 (diff) | |
download | chromium_src-5a068bd029b1d28374f0cf26cbb74bc1ef33bd0c.zip chromium_src-5a068bd029b1d28374f0cf26cbb74bc1ef33bd0c.tar.gz chromium_src-5a068bd029b1d28374f0cf26cbb74bc1ef33bd0c.tar.bz2 |
Fix broken size restoration for bookmark manager. Initializing a rect incorrectly, and clobbering the maximized state during initial sizing.
http://crbug.com/4437
Review URL: http://codereview.chromium.org/10758
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5512 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/views/window.cc')
-rw-r--r-- | chrome/views/window.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/chrome/views/window.cc b/chrome/views/window.cc index fb7d945..e5726c8 100644 --- a/chrome/views/window.cc +++ b/chrome/views/window.cc @@ -87,7 +87,7 @@ gfx::Size Window::CalculateMaximumSize() const { void Window::Show() { int show_state = GetShowState(); bool maximized = false; - if (window_delegate_->GetSavedMaximizedState(&maximized) && maximized) + if (saved_maximized_state_) show_state = SW_SHOWMAXIMIZED; Show(show_state); } @@ -232,7 +232,8 @@ Window::Window(WindowDelegate* window_delegate) restored_enabled_(false), is_always_on_top_(false), window_closed_(false), - disable_inactive_rendering_(false) { + disable_inactive_rendering_(false), + saved_maximized_state_(0) { InitClass(); DCHECK(window_delegate_); window_delegate_->window_.reset(this); @@ -468,6 +469,14 @@ void Window::SetInitialFocus() { } void Window::SetInitialBounds(const gfx::Rect& create_bounds) { + // First we obtain the window's saved show-style and store it. We need to do + // this here, rather than in Show() because by the time Show() is called, + // the window's size will have been reset (below) and the saved maximized + // state will have been lost. Sadly there's no way to tell on Windows when + // a window is restored from maximized state, so we can't more accurately + // track maximized state independently of sizing information. + window_delegate_->GetSavedMaximizedState(&saved_maximized_state_); + // Restore the window's placement from the controller. gfx::Rect saved_bounds(create_bounds.ToRECT()); if (window_delegate_->GetSavedWindowBounds(&saved_bounds)) { |