diff options
author | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-17 21:41:19 +0000 |
---|---|---|
committer | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-17 21:41:19 +0000 |
commit | 3685369c5d08f165697135a527ee3881d1ac7c38 (patch) | |
tree | fce3e2a5f2e9bab81ffc62aca0fba1b579f22184 | |
parent | 11c43a625e83636927e87a0ab99c9ba6ffd77c70 (diff) | |
download | chromium_src-3685369c5d08f165697135a527ee3881d1ac7c38.zip chromium_src-3685369c5d08f165697135a527ee3881d1ac7c38.tar.gz chromium_src-3685369c5d08f165697135a527ee3881d1ac7c38.tar.bz2 |
Fixes two bugs resulting in bad window resize behavior:
. Dragging a tab out was forcing the bounds to fit on the
monitor. This was a regression introduced during some
refactoring. The fix is not to call Window::SetBounds, but instead
SetWindowPos (which is roughly what the old code did).
. When the bounds of the window change always layout. We need this for
the situation where the normal bounds and maximized bounds are the
same because we layout differently in the two.
BUG=5540 5118
TEST=see description in 5118
Review URL: http://codereview.chromium.org/14511
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7169 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/views/window.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/chrome/views/window.cc b/chrome/views/window.cc index 1a388e0..c09ffd0 100644 --- a/chrome/views/window.cc +++ b/chrome/views/window.cc @@ -416,10 +416,9 @@ LRESULT Window::OnSetCursor(HWND window, UINT hittest_code, UINT message) { } void Window::OnSize(UINT size_param, const CSize& new_size) { - if (root_view_->width() == new_size.cx && - root_view_->height() == new_size.cy) - return; - + // Don't no-op if the new_size matches current size. If our normal bounds + // and maximized bounds are the same, then we need to layout (because we + // layout differently when maximized). SaveWindowPosition(); ChangeSize(size_param, new_size); RedrawWindow(GetHWND(), NULL, NULL, RDW_INVALIDATE | RDW_ALLCHILDREN); @@ -512,7 +511,11 @@ void Window::SetInitialBounds(const gfx::Rect& create_bounds) { } // "Show state" (maximized, minimized, etc) is handled by Show(). - SetBounds(saved_bounds, NULL); + // Don't use SetBounds here. SetBounds constrains to the size of the + // monitor, but we don't want that when creating a new window as the result + // of dragging out a tab to create a new window. + SetWindowPos(NULL, saved_bounds.x(), saved_bounds.y(), + saved_bounds.width(), saved_bounds.height(), 0); } else { if (create_bounds.IsEmpty()) { // No initial bounds supplied, so size the window to its content and |