[gnome-shell/gbsneto/40-stuff: 13/68] workspacesView: Add API to hide workspaces without destroying




commit 92e2329e7447d3b59cc9f3d2e44cb9f6735f7062
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Fri Jun 5 02:23:53 2020 -0300

    workspacesView: Add API to hide workspaces without destroying
    
    This will be used by the next commit to hide workspaces when ViewSelector
    switches to the search page, without destroying the workspaces so their
    state is preserved.

 js/ui/workspacesView.js | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
---
diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js
index a7b052cf73..c583e6b6d1 100644
--- a/js/ui/workspacesView.js
+++ b/js/ui/workspacesView.js
@@ -400,6 +400,7 @@ class WorkspacesDisplay extends St.Widget {
             this._syncWorkspacesActualGeometry();
         });
 
+        this._primaryVisible = true;
         this._primaryIndex = Main.layoutManager.primaryIndex;
         this._workspacesViews = [];
 
@@ -562,6 +563,18 @@ class WorkspacesDisplay extends St.Widget {
         return this._getPrimaryView().navigate_focus(from, direction, false);
     }
 
+    setPrimaryWorkspaceVisible(visible) {
+        if (this._primaryVisible === visible)
+            return;
+
+        this._primaryVisible = visible;
+
+        const primaryIndex = Main.layoutManager.primaryIndex;
+        const primaryWorkspace = this._workspacesViews[primaryIndex];
+        if (primaryWorkspace)
+            primaryWorkspace.visible = visible;
+    }
+
     animateToOverview(fadeOnPrimary) {
         this.show();
         this._updateWorkspacesViews();
@@ -659,6 +672,8 @@ class WorkspacesDisplay extends St.Widget {
             this._workspacesViews.push(view);
             Main.layoutManager.overviewGroup.add_actor(view);
         }
+
+        this._workspacesViews[this._primaryIndex].visible = this._primaryVisible;
     }
 
     _getMonitorIndexForEvent(event) {


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