[gnome-shell/wip/jimmac/dash-icon-spacing: 11/72] workspacesView: Add API to hide workspaces without destroying
- From: Jakub Steiner <jimmac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/jimmac/dash-icon-spacing: 11/72] workspacesView: Add API to hide workspaces without destroying
- Date: Tue, 2 Feb 2021 11:58:17 +0000 (UTC)
commit 0306718fd89f337e130af24eb211ef664c3fbdec
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 fa3987e226..e9b838fde9 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 = [];
@@ -566,6 +567,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();
@@ -668,6 +681,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]