| 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 1443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1454 // (In that case Stop() is a no-op.) | 1454 // (In that case Stop() is a no-op.) |
| 1455 window_configure_debounce_timer_.Stop(); | 1455 window_configure_debounce_timer_.Stop(); |
| 1456 window_configure_debounce_timer_.Start(FROM_HERE, | 1456 window_configure_debounce_timer_.Start(FROM_HERE, |
| 1457 base::TimeDelta::FromMilliseconds(kDebounceTimeoutMilliseconds), this, | 1457 base::TimeDelta::FromMilliseconds(kDebounceTimeoutMilliseconds), this, |
| 1458 &BrowserWindowGtk::OnDebouncedBoundsChanged); | 1458 &BrowserWindowGtk::OnDebouncedBoundsChanged); |
| 1459 | 1459 |
| 1460 return FALSE; | 1460 return FALSE; |
| 1461 } | 1461 } |
| 1462 | 1462 |
| 1463 void BrowserWindowGtk::OnDebouncedBoundsChanged() { | 1463 void BrowserWindowGtk::OnDebouncedBoundsChanged() { |
| 1464 gint x, y; | 1464 gtk_window_util::UpdateWindowPosition(this, &bounds_, &restored_bounds_); |
| 1465 gtk_window_get_position(window_, &x, &y); | |
| 1466 bounds_.set_origin(gfx::Point(x, y)); | |
| 1467 if (!IsFullscreen() && !IsMaximized()) | |
| 1468 restored_bounds_ = bounds_; | |
| 1469 SaveWindowPosition(); | 1465 SaveWindowPosition(); |
| 1470 } | 1466 } |
| 1471 | 1467 |
| 1472 gboolean BrowserWindowGtk::OnWindowState(GtkWidget* sender, | 1468 gboolean BrowserWindowGtk::OnWindowState(GtkWidget* sender, |
| 1473 GdkEventWindowState* event) { | 1469 GdkEventWindowState* event) { |
| 1474 state_ = event->new_window_state; | 1470 state_ = event->new_window_state; |
| 1475 | 1471 |
| 1476 if (event->changed_mask & GDK_WINDOW_STATE_FULLSCREEN) { | 1472 if (event->changed_mask & GDK_WINDOW_STATE_FULLSCREEN) { |
| 1477 browser_->WindowFullscreenStateChanged(); | 1473 browser_->WindowFullscreenStateChanged(); |
| 1478 if (state_ & GDK_WINDOW_STATE_FULLSCREEN) { | 1474 if (state_ & GDK_WINDOW_STATE_FULLSCREEN) { |
| (...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2432 wm_type == ui::WM_OPENBOX || | 2428 wm_type == ui::WM_OPENBOX || |
| 2433 wm_type == ui::WM_XFWM4); | 2429 wm_type == ui::WM_XFWM4); |
| 2434 } | 2430 } |
| 2435 | 2431 |
| 2436 // static | 2432 // static |
| 2437 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { | 2433 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { |
| 2438 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); | 2434 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); |
| 2439 browser_window_gtk->Init(); | 2435 browser_window_gtk->Init(); |
| 2440 return browser_window_gtk; | 2436 return browser_window_gtk; |
| 2441 } | 2437 } |
| OLD | NEW |