| OLD | NEW |
| 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 Loading... |
| 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 = chrome::GetSavedWindowBoundsAndShowState( |
| 1670 | 1670 browser_.get(), |
| 1671 gfx::Rect bounds = chrome::GetSavedWindowBounds(browser_.get()); | 1671 show_state_after_show_); |
| 1672 // We don't blindly call SetBounds here: that sets a forced position | 1672 // 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 | 1673 // on the window and we intentionally *don't* do that for normal |
| 1674 // windows. Most programs do not restore their window position on | 1674 // windows. Most programs do not restore their window position on |
| 1675 // Linux, instead letting the window manager choose a position. | 1675 // Linux, instead letting the window manager choose a position. |
| 1676 // | 1676 // |
| 1677 // However, in cases like dropping a tab where the bounds are | 1677 // However, in cases like dropping a tab where the bounds are |
| 1678 // specifically set, we do want to position explicitly. We also | 1678 // specifically set, we do want to position explicitly. We also |
| 1679 // force the position as part of session restore, as applications | 1679 // force the position as part of session restore, as applications |
| 1680 // that restore other, similar state (for instance GIMP, audacity, | 1680 // that restore other, similar state (for instance GIMP, audacity, |
| 1681 // pidgin, dia, and gkrellm) do tend to restore their positions. | 1681 // pidgin, dia, and gkrellm) do tend to restore their positions. |
| (...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2417 wm_type == ui::WM_OPENBOX || | 2417 wm_type == ui::WM_OPENBOX || |
| 2418 wm_type == ui::WM_XFWM4); | 2418 wm_type == ui::WM_XFWM4); |
| 2419 } | 2419 } |
| 2420 | 2420 |
| 2421 // static | 2421 // static |
| 2422 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { | 2422 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { |
| 2423 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); | 2423 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); |
| 2424 browser_window_gtk->Init(); | 2424 browser_window_gtk->Init(); |
| 2425 return browser_window_gtk; | 2425 return browser_window_gtk; |
| 2426 } | 2426 } |
| OLD | NEW |