[gnome-shell] workspacesView: Add API to hide workspaces without destroying



commit a29e002a41a03bb3d2220d2de79c090e0717fa10
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.
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1593>

 js/ui/workspacesView.js | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
---
diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js
index 99a1e65973..9e1dccb0f7 100644
--- a/js/ui/workspacesView.js
+++ b/js/ui/workspacesView.js
@@ -404,6 +404,7 @@ class WorkspacesDisplay extends St.Widget {
             this._syncWorkspacesActualGeometry();
         });
 
+        this._primaryVisible = true;
         this._primaryIndex = Main.layoutManager.primaryIndex;
         this._workspacesViews = [];
 
@@ -570,6 +571,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();
@@ -672,6 +685,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]