[gnome-documents] windowMode: cope better with WM fullscreen events



commit 2394fa73a3eac3557d0a1ac88c9b9b2407d79f3b
Author: Cosimo Cecchi <cosimo endlesm com>
Date:   Wed Dec 24 15:57:40 2014 +0800

    windowMode: cope better with WM fullscreen events
    
    The window manager can fullscreen us at any time. Make that situation
    consistent with being fullscreened by our own action.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=725634

 src/mainWindow.js |    6 +++++-
 src/windowMode.js |    7 -------
 2 files changed, 5 insertions(+), 8 deletions(-)
---
diff --git a/src/mainWindow.js b/src/mainWindow.js
index 2d60b4a..244d3e2 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -129,8 +129,12 @@ const MainWindow = new Lang.Class({
         let window = widget.get_window();
         let state = window.get_state();
 
-        if (state & Gdk.WindowState.FULLSCREEN)
+        if (state & Gdk.WindowState.FULLSCREEN) {
+            Application.modeController.setFullscreen(true);
             return;
+        }
+
+        Application.modeController.setFullscreen(false);
 
         let maximized = (state & Gdk.WindowState.MAXIMIZED);
         Application.settings.set_boolean('window-maximized', maximized);
diff --git a/src/windowMode.js b/src/windowMode.js
index 3f90364..50ecd16 100644
--- a/src/windowMode.js
+++ b/src/windowMode.js
@@ -74,16 +74,9 @@ const ModeController = new Lang.Class({
     },
 
     setFullscreen: function(fullscreen) {
-        if (this._mode != WindowMode.PREVIEW
-            && this._mode != WindowMode.EDIT)
-            return;
-
         if (this._fullscreen == fullscreen)
             return;
 
-        if (fullscreen && !this._canFullscreen)
-            return;
-
         this._fullscreen = fullscreen;
         this.emit('fullscreen-changed', this._fullscreen);
     },


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]