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

Unified Diff: chrome/browser/gtk/browser_window_gtk.cc

Issue 174215: Fix issue 19785: Chrome enters full-screen mode when a maximized window is mo... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/gtk/browser_window_gtk.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
« no previous file with comments | « chrome/browser/gtk/browser_window_gtk.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698