[gnome-shell] workspace: Disable preview overlays unless fully zoomed out



commit b5d925817fbeafaf44ee54a4c768c27f4945a9f6
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Jun 26 17:06:38 2020 +0200

    workspace: Disable preview overlays unless fully zoomed out
    
    The overlays are only meant to be shown when the workspace is fully
    zoomed out, not when using the floating layout or some in-between state.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1345

 js/ui/workspace.js | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/workspace.js b/js/ui/workspace.js
index b84c45b1f0..14670d1004 100644
--- a/js/ui/workspace.js
+++ b/js/ui/workspace.js
@@ -416,8 +416,11 @@ var WorkspaceLayout = GObject.registerClass({
             upper: 1,
         });
 
-        this._stateAdjustment.connect('notify::value', () =>
-            this.layout_changed());
+        this._stateAdjustment.connect('notify::value', () => {
+            [...this._windows.keys()].forEach(
+                preview => this._syncOverlay(preview));
+            this.layout_changed();
+        });
     }
 
     _isBetterLayout(oldLayout, newLayout) {
@@ -632,6 +635,10 @@ var WorkspaceLayout = GObject.registerClass({
         }
     }
 
+    _syncOverlay(preview) {
+        preview.overlay_enabled = this._stateAdjustment.value === 1;
+    }
+
     /**
      * addWindow:
      * @param {WindowPreview} window: the window to add
@@ -665,6 +672,7 @@ var WorkspaceLayout = GObject.registerClass({
             return winA.get_stable_sequence() - winB.get_stable_sequence();
         });
 
+        this._syncOverlay(window);
         this._container.add_child(window);
 
         this._layout = null;


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