summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-20 21:03:09 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-20 21:03:09 +0000
commit176e7f48e77b95ca38cd5c34846eabdb3eec8570 (patch)
tree46e9a07d57cfda6c47b469d43123cafcf1aad505 /chrome/browser/gtk
parentd99671151e98412870f1adf719b4a94fc9a7ca52 (diff)
downloadchromium_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')
-rw-r--r--chrome/browser/gtk/browser_window_gtk.cc22
-rw-r--r--chrome/browser/gtk/browser_window_gtk.h7
2 files changed, 14 insertions, 15 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() {
diff --git a/chrome/browser/gtk/browser_window_gtk.h b/chrome/browser/gtk/browser_window_gtk.h
index d010d31..70bd91c 100644
--- a/chrome/browser/gtk/browser_window_gtk.h
+++ b/chrome/browser/gtk/browser_window_gtk.h
@@ -264,9 +264,10 @@ class BrowserWindowGtk : public BrowserWindow,
void SaveWindowPosition();
// Set the bounds of the current window. If |exterior| is true, set the size
- // of the window itself, otherwise set the bounds of the web contents. In
- // either case, set the position of the window.
- void SetBoundsImpl(const gfx::Rect& bounds, bool exterior);
+ // of the window itself, otherwise set the bounds of the web contents.
+ // If |move| is true, set the position of the window, otherwise leave the
+ // position to the WM.
+ void SetBoundsImpl(const gfx::Rect& bounds, bool exterior, bool move);
// Callback for when the custom frame alignment needs to be redrawn.
// The content area includes the toolbar and web page but not the tab strip.