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

Side by Side Diff: chrome/browser/ui/gtk/browser_window_gtk.cc

Issue 11072002: Combined window positioning and show state determiniation in the WindowSizer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed more build issues Created 8 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/gtk/browser_window_gtk.h" 5 #include "chrome/browser/ui/gtk/browser_window_gtk.h"
6 6
7 #include <gdk/gdkkeysyms.h> 7 #include <gdk/gdkkeysyms.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <string> 10 #include <string>
(...skipping 1648 matching lines...) Expand 10 before | Expand all | Expand 10 after
1659 1659
1660 void BrowserWindowGtk::QueueToolbarRedraw() { 1660 void BrowserWindowGtk::QueueToolbarRedraw() {
1661 gtk_widget_queue_draw(toolbar_->widget()); 1661 gtk_widget_queue_draw(toolbar_->widget());
1662 } 1662 }
1663 1663
1664 void BrowserWindowGtk::SetGeometryHints() { 1664 void BrowserWindowGtk::SetGeometryHints() {
1665 // If we call gtk_window_maximize followed by gtk_window_present, compiz gets 1665 // If we call gtk_window_maximize followed by gtk_window_present, compiz gets
1666 // confused and maximizes the window, but doesn't set the 1666 // confused and maximizes the window, but doesn't set the
1667 // GDK_WINDOW_STATE_MAXIMIZED bit. So instead, we keep track of whether to 1667 // GDK_WINDOW_STATE_MAXIMIZED bit. So instead, we keep track of whether to
1668 // maximize and call it after gtk_window_present. 1668 // maximize and call it after gtk_window_present.
1669 show_state_after_show_ = chrome::GetSavedWindowShowState(browser_.get()); 1669 gfx::Rect bounds;
1670 1670 chrome::GetSavedWindowBoundsAndShowState(browser_.get(),
1671 gfx::Rect bounds = chrome::GetSavedWindowBounds(browser_.get()); 1671 &bounds,
1672 &show_state_after_show_);
1672 // We don't blindly call SetBounds here: that sets a forced position 1673 // We don't blindly call SetBounds here: that sets a forced position
1673 // on the window and we intentionally *don't* do that for normal 1674 // on the window and we intentionally *don't* do that for normal
1674 // windows. Most programs do not restore their window position on 1675 // windows. Most programs do not restore their window position on
1675 // Linux, instead letting the window manager choose a position. 1676 // Linux, instead letting the window manager choose a position.
1676 // 1677 //
1677 // However, in cases like dropping a tab where the bounds are 1678 // However, in cases like dropping a tab where the bounds are
1678 // specifically set, we do want to position explicitly. We also 1679 // specifically set, we do want to position explicitly. We also
1679 // force the position as part of session restore, as applications 1680 // force the position as part of session restore, as applications
1680 // that restore other, similar state (for instance GIMP, audacity, 1681 // that restore other, similar state (for instance GIMP, audacity,
1681 // pidgin, dia, and gkrellm) do tend to restore their positions. 1682 // pidgin, dia, and gkrellm) do tend to restore their positions.
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after
2417 wm_type == ui::WM_OPENBOX || 2418 wm_type == ui::WM_OPENBOX ||
2418 wm_type == ui::WM_XFWM4); 2419 wm_type == ui::WM_XFWM4);
2419 } 2420 }
2420 2421
2421 // static 2422 // static
2422 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { 2423 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) {
2423 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); 2424 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser);
2424 browser_window_gtk->Init(); 2425 browser_window_gtk->Init();
2425 return browser_window_gtk; 2426 return browser_window_gtk;
2426 } 2427 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698