diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-20 21:03:09 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-20 21:03:09 +0000 |
commit | 176e7f48e77b95ca38cd5c34846eabdb3eec8570 (patch) | |
tree | 46e9a07d57cfda6c47b469d43123cafcf1aad505 /chrome/browser/gtk/browser_window_gtk.cc | |
parent | d99671151e98412870f1adf719b4a94fc9a7ca52 (diff) | |
download | chromium_src-176e7f48e77b95ca38cd5c34846eabdb3eec8570.zip chromium_src-176e7f48e77b95ca38cd5c34846eabdb3eec8570.tar.gz chromium_src-176e7f48e77b95ca38cd5c34846eabdb3eec8570.tar.bz2 |
[GTK] handle popup window resize events properly.
BUG=51586
TEST=see bug for repro
Review URL: http://codereview.chromium.org/3388012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59974 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/browser_window_gtk.cc')
-rw-r--r-- | chrome/browser/gtk/browser_window_gtk.cc | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/chrome/browser/gtk/browser_window_gtk.cc b/chrome/browser/gtk/browser_window_gtk.cc index 39c2dde..954a664 100644 --- a/chrome/browser/gtk/browser_window_gtk.cc +++ b/chrome/browser/gtk/browser_window_gtk.cc @@ -646,13 +646,16 @@ void BrowserWindowGtk::Show() { gtk_widget_set_size_request(contents_container_->widget(), -1, -1); } -void BrowserWindowGtk::SetBoundsImpl(const gfx::Rect& bounds, bool exterior) { +void BrowserWindowGtk::SetBoundsImpl(const gfx::Rect& bounds, + bool exterior, + bool move) { gint x = static_cast<gint>(bounds.x()); gint y = static_cast<gint>(bounds.y()); gint width = static_cast<gint>(bounds.width()); gint height = static_cast<gint>(bounds.height()); - gtk_window_move(window_, x, y); + if (move) + gtk_window_move(window_, x, y); if (exterior) { SetWindowSize(window_, gfx::Size(width, height)); @@ -663,7 +666,7 @@ void BrowserWindowGtk::SetBoundsImpl(const gfx::Rect& bounds, bool exterior) { } void BrowserWindowGtk::SetBounds(const gfx::Rect& bounds) { - SetBoundsImpl(bounds, true); + SetBoundsImpl(bounds, true, true); } void BrowserWindowGtk::Close() { @@ -1500,15 +1503,10 @@ void BrowserWindowGtk::SetGeometryHints() { // For popup windows, we assume that if x == y == 0, the opening page // did not specify a position. Let the WM position the popup instead. bool is_popup = browser_->type() & Browser::TYPE_POPUP; - bool popup_without_position = is_popup && bounds.x() == 0 && bounds.y() == 0; - if (browser_->bounds_overridden() && !popup_without_position) { - // For popups, bounds are set in terms of the client area rather than the - // entire window. - SetBoundsImpl(bounds, !is_popup); - } else { - // Ignore the position but obey the size. - SetWindowSize(window_, bounds.size()); - } + bool popup_without_position = is_popup && + bounds.x() == 0 && bounds.y() == 0; + bool move = browser_->bounds_overridden() && !popup_without_position; + SetBoundsImpl(bounds, !is_popup, move); } void BrowserWindowGtk::ConnectHandlersToSignals() { |