| 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 1490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1501 // (In that case Stop() is a no-op.) | 1501 // (In that case Stop() is a no-op.) |
| 1502 window_configure_debounce_timer_.Stop(); | 1502 window_configure_debounce_timer_.Stop(); |
| 1503 window_configure_debounce_timer_.Start(FROM_HERE, | 1503 window_configure_debounce_timer_.Start(FROM_HERE, |
| 1504 base::TimeDelta::FromMilliseconds(kDebounceTimeoutMilliseconds), this, | 1504 base::TimeDelta::FromMilliseconds(kDebounceTimeoutMilliseconds), this, |
| 1505 &BrowserWindowGtk::OnDebouncedBoundsChanged); | 1505 &BrowserWindowGtk::OnDebouncedBoundsChanged); |
| 1506 | 1506 |
| 1507 return FALSE; | 1507 return FALSE; |
| 1508 } | 1508 } |
| 1509 | 1509 |
| 1510 void BrowserWindowGtk::OnDebouncedBoundsChanged() { | 1510 void BrowserWindowGtk::OnDebouncedBoundsChanged() { |
| 1511 gint x, y; | 1511 gtk_window_util::UpdateWindowPosition(this, &bounds_, &restored_bounds_); |
| 1512 gtk_window_get_position(window_, &x, &y); | |
| 1513 bounds_.set_origin(gfx::Point(x, y)); | |
| 1514 if (!IsFullscreen() && !IsMaximized()) | |
| 1515 restored_bounds_ = bounds_; | |
| 1516 SaveWindowPosition(); | 1512 SaveWindowPosition(); |
| 1517 } | 1513 } |
| 1518 | 1514 |
| 1519 gboolean BrowserWindowGtk::OnWindowState(GtkWidget* sender, | 1515 gboolean BrowserWindowGtk::OnWindowState(GtkWidget* sender, |
| 1520 GdkEventWindowState* event) { | 1516 GdkEventWindowState* event) { |
| 1521 state_ = event->new_window_state; | 1517 state_ = event->new_window_state; |
| 1522 | 1518 |
| 1523 if (event->changed_mask & GDK_WINDOW_STATE_FULLSCREEN) { | 1519 if (event->changed_mask & GDK_WINDOW_STATE_FULLSCREEN) { |
| 1524 browser_->WindowFullscreenStateChanged(); | 1520 browser_->WindowFullscreenStateChanged(); |
| 1525 if (state_ & GDK_WINDOW_STATE_FULLSCREEN) { | 1521 if (state_ & GDK_WINDOW_STATE_FULLSCREEN) { |
| (...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2479 wm_type == ui::WM_OPENBOX || | 2475 wm_type == ui::WM_OPENBOX || |
| 2480 wm_type == ui::WM_XFWM4); | 2476 wm_type == ui::WM_XFWM4); |
| 2481 } | 2477 } |
| 2482 | 2478 |
| 2483 // static | 2479 // static |
| 2484 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { | 2480 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { |
| 2485 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); | 2481 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); |
| 2486 browser_window_gtk->Init(); | 2482 browser_window_gtk->Init(); |
| 2487 return browser_window_gtk; | 2483 return browser_window_gtk; |
| 2488 } | 2484 } |
| OLD | NEW |