Commit d0da96ad authored by Florian Müllner's avatar Florian Müllner

workspacesView: Handle reordering of workspaces

MetaWorkspaceManager gained the ability to reorder workspaces, so make
sure to pick up the new order when that happens.

!620
parent 55b03617
......@@ -101,6 +101,14 @@ var WorkspacesView = class extends WorkspacesViewBase {
this._updateWorkspacesId =
workspaceManager.connect('notify::n-workspaces',
this._updateWorkspaces.bind(this));
this._reorderWorkspacesId =
workspaceManager.connect('workspaces-reordered', () => {
this._workspaces.sort((a, b) => {
return a.metaWorkspace.index() - b.metaWorkspace.index();
});
this._updateWorkspaceActors(false);
});
this._overviewShownId =
Main.overview.connect('shown', () => {
......@@ -287,6 +295,7 @@ var WorkspacesView = class extends WorkspacesViewBase {
global.window_manager.disconnect(this._switchWorkspaceNotifyId);
let workspaceManager = global.workspace_manager;
workspaceManager.disconnect(this._updateWorkspacesId);
workspaceManager.disconnect(this._reorderWorkspacesId);
}
startSwipeScroll() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment