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

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

Issue 218040: Linux: work around browser windows that get stuck maximized by the WM. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 3 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 27114)
+++ chrome/browser/gtk/browser_window_gtk.cc (working copy)
@@ -1378,6 +1378,17 @@
SaveWindowPosition();
}
+void BrowserWindowGtk::UnMaximize() {
+ // It can happen that you end up with a window whose restore size is the same
+ // as the size of the screen, so unmaximizing it merely remaximizes it due to
+ // the same WM feature that SetWindowSize() works around. We try to detect
+ // this and resize the window to work around the issue.
+ if (bounds_.size() == restored_bounds_.size())
+ gtk_window_resize(window_, bounds_.width(), bounds_.height() - 1);
+ else
+ gtk_window_unmaximize(window_);
+}
+
bool BrowserWindowGtk::CanClose() const {
#if defined(OS_CHROMEOS)
if (drag_active_)
@@ -2004,7 +2015,7 @@
if (has_hit_titlebar) {
// Maximize/restore on double click.
if (browser->IsMaximized()) {
- gtk_window_unmaximize(browser->window_);
+ browser->UnMaximize();
} else {
gtk_window_maximize(browser->window_);
}
« 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