summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/browser_window_gtk.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/gtk/browser_window_gtk.cc')
-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());