summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-07 00:44:19 +0000
committertony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-07 00:44:19 +0000
commit4275c9232b11c2a8b435115f8742e0ecb3d59905 (patch)
tree155816f4ea7351c1e39c6e4c6a54609d42f197c6
parentab6ca394ecbd94f389270f4fbe55ac889f96979b (diff)
downloadchromium_src-4275c9232b11c2a8b435115f8742e0ecb3d59905.zip
chromium_src-4275c9232b11c2a8b435115f8742e0ecb3d59905.tar.gz
chromium_src-4275c9232b11c2a8b435115f8742e0ecb3d59905.tar.bz2
Only place popup windows if the position is not 0,0.
BUG=36650 Review URL: http://codereview.chromium.org/1520019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43790 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/gtk/browser_window_gtk.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/chrome/browser/gtk/browser_window_gtk.cc b/chrome/browser/gtk/browser_window_gtk.cc
index 30f5217..9ce3119 100644
--- a/chrome/browser/gtk/browser_window_gtk.cc
+++ b/chrome/browser/gtk/browser_window_gtk.cc
@@ -1398,10 +1398,15 @@ void BrowserWindowGtk::SetGeometryHints() {
// force the position as part of session restore, as applications
// that restore other, similar state (for instance GIMP, audacity,
// pidgin, dia, and gkrellm) do tend to restore their positions.
- if (browser_->bounds_overridden()) {
+ //
+ // 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, !(browser_->type() & Browser::TYPE_POPUP));
+ SetBoundsImpl(bounds, !is_popup);
} else {
// Ignore the position but obey the size.
SetWindowSize(window_, bounds.width(), bounds.height());