summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/browser.h4
-rw-r--r--chrome/browser/gtk/browser_window_gtk.cc17
2 files changed, 17 insertions, 4 deletions
diff --git a/chrome/browser/browser.h b/chrome/browser/browser.h
index 4c4555d..d4196ae 100644
--- a/chrome/browser/browser.h
+++ b/chrome/browser/browser.h
@@ -102,6 +102,10 @@ class Browser : public TabStripModelDelegate,
void set_maximized_state(MaximizedState state) {
maximized_state_ = state;
}
+ // Return true if the initial window bounds have been overridden.
+ bool bounds_overridden() const {
+ return !override_bounds_.IsEmpty();
+ }
// Creates the Browser Window. Prefer to use the static helpers above where
// possible. This does not show the window. You need to call window()->Show()
diff --git a/chrome/browser/gtk/browser_window_gtk.cc b/chrome/browser/gtk/browser_window_gtk.cc
index ae8c547..2ebc1cf 100644
--- a/chrome/browser/gtk/browser_window_gtk.cc
+++ b/chrome/browser/gtk/browser_window_gtk.cc
@@ -1070,10 +1070,19 @@ void BrowserWindowGtk::SetGeometryHints() {
gtk_window_unmaximize(window_);
gfx::Rect bounds = browser_->GetSavedWindowBounds();
- // Note that calling SetBounds() here is incorrect, as that sets a forced
- // position on the window and we intentionally *don't* do that. We tested
- // many programs and none of them restored their position on Linux.
- gtk_window_resize(window_, bounds.width(), bounds.height());
+ // We don't blindly call SetBounds here, that sets a forced position
+ // on the window and we intentionally *don't* do that for normal
+ // windows. We tested many programs and none of them restored their
+ // position on Linux.
+ //
+ // However, in cases like dropping a tab where the bounds are
+ // specifically set, we do want to position explicitly.
+ if (browser_->bounds_overridden()) {
+ SetBounds(bounds);
+ } else {
+ // Ignore the position but obey the size.
+ gtk_window_resize(window_, bounds.width(), bounds.height());
+ }
}
void BrowserWindowGtk::ConnectHandlersToSignals() {