[gnome-shell-extensions/wip/rstrode/heads-up-display: 40/62] workspace-indicator: Minor cleanup




commit 5f5cc930db3d09f84c12b2194a4ece03d5501c63
Author: Florian Müllner <fmuellner gnome org>
Date:   Sun Jun 9 23:05:00 2019 +0000

    workspace-indicator: Minor cleanup
    
    Mutter has a dedicated method for getting the index of the active
    workspace, use that instead of getting first the active workspace
    and then its index.
    
    https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/71

 extensions/workspace-indicator/extension.js | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/extensions/workspace-indicator/extension.js b/extensions/workspace-indicator/extension.js
index 205ee36..7ebc1f0 100644
--- a/extensions/workspace-indicator/extension.js
+++ b/extensions/workspace-indicator/extension.js
@@ -22,7 +22,7 @@ class WorkspaceIndicator extends PanelMenu.Button {
 
         let workspaceManager = global.workspace_manager;
 
-        this._currentWorkspace = workspaceManager.get_active_workspace().index();
+        this._currentWorkspace = workspaceManager.get_active_workspace_index();
         this._statusLabel = new St.Label({
             y_align: Clutter.ActorAlign.CENTER,
             text: this._labelText()
@@ -68,7 +68,7 @@ class WorkspaceIndicator extends PanelMenu.Button {
 
     _updateIndicator() {
         this._workspacesItems[this._currentWorkspace].setOrnament(PopupMenu.Ornament.NONE);
-        this._currentWorkspace = global.workspace_manager.get_active_workspace().index();
+        this._currentWorkspace = global.workspace_manager.get_active_workspace_index();
         this._workspacesItems[this._currentWorkspace].setOrnament(PopupMenu.Ornament.DOT);
 
         this._statusLabel.set_text(this._labelText());
@@ -92,7 +92,7 @@ class WorkspaceIndicator extends PanelMenu.Button {
 
         this._workspaceSection.removeAll();
         this._workspacesItems = [];
-        this._currentWorkspace = workspaceManager.get_active_workspace().index();
+        this._currentWorkspace = workspaceManager.get_active_workspace_index();
 
         let i = 0;
         for (; i < workspaceManager.n_workspaces; i++) {
@@ -131,7 +131,7 @@ class WorkspaceIndicator extends PanelMenu.Button {
             return;
         }
 
-        let newIndex = global.workspace_manager.get_active_workspace().index() + diff;
+        let newIndex = global.workspace_manager.get_active_workspace_index() + diff;
         this._activate(newIndex);
     }
 });


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