[gnome-shell] windowManager: Handle reordering of workspaces



commit 6205d5eb27dbab83f7387cb479cd3b5b7bd4495a
Author: Florian Müllner <fmuellner gnome org>
Date:   Tue Oct 8 20:27:34 2019 +0200

    windowManager: Handle reordering of workspaces
    
    MetaWorkspaceManager gained the ability to reorder workspaces, so make
    sure to pick up the new order when that happens.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/issues/1497

 js/ui/windowManager.js | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js
index 11837c46a7..ff2f089645 100644
--- a/js/ui/windowManager.js
+++ b/js/ui/windowManager.js
@@ -187,6 +187,9 @@ var WorkspaceTracker = class {
         let workspaceManager = global.workspace_manager;
         workspaceManager.connect('notify::n-workspaces',
                                  this._nWorkspacesChanged.bind(this));
+        workspaceManager.connect('workspaces-reordered', () => {
+            this._workspaces.sort((a, b) => a.index() - b.index());
+        });
         global.window_manager.connect('switch-workspace',
                                       this._queueCheckWorkspaces.bind(this));
 


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