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
This commit is contained in:
Florian Müllner 2019-10-08 20:27:34 +02:00
parent a722b4c51d
commit 6205d5eb27

View File

@ -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));