Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2993)

Unified Diff: chrome/browser/gtk/browser_window_gtk.cc

Issue 159316: linux: obey window positioning information when bounds are overridden (Closed)
Patch Set: seems to work Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/browser.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/browser_window_gtk.cc
diff --git a/chrome/browser/gtk/browser_window_gtk.cc b/chrome/browser/gtk/browser_window_gtk.cc
index ae8c54793d58a70af5506e27d17d4641c84ac6bb..2ebc1cfceea73879fb17b5152a936cf21708b681 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() {
« no previous file with comments | « chrome/browser/browser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698