| Index: chrome/browser/gtk/browser_window_gtk.cc
|
| ===================================================================
|
| --- chrome/browser/gtk/browser_window_gtk.cc (revision 23948)
|
| +++ chrome/browser/gtk/browser_window_gtk.cc (working copy)
|
| @@ -487,7 +487,9 @@
|
| is_active_(true),
|
| last_click_time_(0),
|
| maximize_after_show_(false),
|
| - accel_group_(NULL) {
|
| + accel_group_(NULL),
|
| + set_fullscreen_(false),
|
| + fullscreen_(false) {
|
| use_custom_frame_.Init(prefs::kUseCustomChromeFrame,
|
| browser_->profile()->GetPrefs(), this);
|
|
|
| @@ -893,6 +895,7 @@
|
| }
|
|
|
| void BrowserWindowGtk::SetFullscreen(bool fullscreen) {
|
| + set_fullscreen_ = fullscreen;
|
| // gtk_window_(un)fullscreen asks the window manager to toggle the EWMH
|
| // for fullscreen windows. Not all window managers support this.
|
| if (fullscreen) {
|
| @@ -903,7 +906,7 @@
|
| }
|
|
|
| bool BrowserWindowGtk::IsFullscreen() const {
|
| - return (state_ & GDK_WINDOW_STATE_FULLSCREEN);
|
| + return fullscreen_;
|
| }
|
|
|
| LocationBar* BrowserWindowGtk::GetLocationBar() const {
|
| @@ -1218,6 +1221,9 @@
|
| }
|
|
|
| void BrowserWindowGtk::OnBoundsChanged(const gfx::Rect& bounds) {
|
| + if (bounds_ == bounds)
|
| + return;
|
| +
|
| GetLocationBar()->location_entry()->ClosePopup();
|
|
|
| if (bounds_.size() != bounds.size())
|
| @@ -1231,10 +1237,22 @@
|
|
|
| void BrowserWindowGtk::OnStateChanged(GdkWindowState state,
|
| GdkWindowState changed_mask) {
|
| + bool fullscreen_state = (state & GDK_WINDOW_STATE_FULLSCREEN);
|
| + bool fullscreen_state_changed = (changed_mask & GDK_WINDOW_STATE_FULLSCREEN);
|
| + bool is_fullscreen = set_fullscreen_ && fullscreen_state;
|
| +
|
| state_ = state;
|
|
|
| - if (changed_mask & GDK_WINDOW_STATE_FULLSCREEN) {
|
| - bool is_fullscreen = state & GDK_WINDOW_STATE_FULLSCREEN;
|
| + // If Window Manager turns our window into fullscreen automatically
|
| + // without our request, then we need to turn it back, because we do not
|
| + // really want to be in fullscreen mode.
|
| + if (fullscreen_state_changed && fullscreen_state && !set_fullscreen_) {
|
| + gtk_window_unfullscreen(window_);
|
| + return;
|
| + }
|
| +
|
| + if (fullscreen_ != is_fullscreen) {
|
| + fullscreen_ = is_fullscreen;
|
| browser_->UpdateCommandsForFullscreenMode(is_fullscreen);
|
| if (is_fullscreen) {
|
| UpdateCustomFrame();
|
| @@ -1248,9 +1266,6 @@
|
| ShowSupportedWindowFeatures();
|
| }
|
| }
|
| -
|
| - UpdateWindowShape(bounds_.width(), bounds_.height());
|
| - SaveWindowPosition();
|
| }
|
|
|
| bool BrowserWindowGtk::CanClose() const {
|
|
|