From 78f6dec73b087b0a69ceec1b9d928915d2279bb9 Mon Sep 17 00:00:00 2001 From: Seif Lotfy Date: Fri, 19 Oct 2012 13:55:18 +0200 Subject: [PATCH] workspacesView: Don't show workspace switcher when it doesn't make sense Hide workspace switcher if dynamic workspaces is disabled and number of workspaces is set to one only, since the user is bound to only one workspace and showing the switcher is redundant. Signed-off-by: Seif Lotfy --- js/ui/workspacesView.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js index edb636b09..3832efaef 100644 --- a/js/ui/workspacesView.js +++ b/js/ui/workspacesView.js @@ -541,6 +541,16 @@ const WorkspacesDisplay = new Lang.Class({ this._notifyOpacityId = 0; this._swipeScrollBeginId = 0; this._swipeScrollEndId = 0; + + this._settings = new Gio.Settings({ schema: OVERRIDE_SCHEMA }); + this._settings.connect('changed::dynamic-workspaces', + Lang.bind(this, this._updateSwitcherVisibility)); + }, + + _updateSwitcherVisibility: function() { + this._thumbnailsBox.actor.visible = + this._settings.get_boolean('dynamic-workspaces') || + global.screen.n_workspaces > 1; }, show: function() { @@ -563,6 +573,7 @@ const WorkspacesDisplay = new Lang.Class({ this._controls.show(); this._thumbnailsBox.show(); + this._updateSwitcherVisibility(); this._updateWorkspacesViews(); @@ -974,6 +985,7 @@ const WorkspacesDisplay = new Lang.Class({ for (let i = 0; i < this._workspacesViews.length; i++) this._workspacesViews[i].updateWorkspaces(oldNumWorkspaces, newNumWorkspaces); + this._updateSwitcherVisibility(); }, _updateZoom : function() {