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

Unified Diff: ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc

Issue 405743004: Fix unfullscreening a maximized window in Metacity (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
index 002d20b0a65d18495eba28e674e3888ac319a0f2..ebbd90410c82818939a494bc89e5a802eaab9d76 100644
--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
+++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
@@ -682,9 +682,22 @@ void DesktopWindowTreeHostX11::SetFullscreen(bool fullscreen) {
if (is_fullscreen_ == fullscreen)
return;
is_fullscreen_ = fullscreen;
+
+ // Work around a bug where if we try to unfullscreen, metacity immediately
+ // fullscreens us again. This is a little flickery and not necessary if
+ // there's a gnome-panel, but it's not easy to detect whether there's a
+ // panel or not.
+ bool unmaximize_and_remaximize = !fullscreen && IsMaximized() &&
+ ui::GuessWindowManager() == ui::WM_METACITY;
+
+ if (unmaximize_and_remaximize)
+ Restore();
SetWMSpecState(fullscreen,
atom_cache_.GetAtom("_NET_WM_STATE_FULLSCREEN"),
None);
+ if (unmaximize_and_remaximize)
+ Maximize();
+
// Try to guess the size we will have after the switch to/from fullscreen:
// - (may) avoid transient states
// - works around Flash content which expects to have the size updated
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698