diff --git a/js/ui/windowMenu.js b/js/ui/windowMenu.js index 628f145..f8eb439 100644 --- a/js/ui/windowMenu.js +++ b/js/ui/windowMenu.js @@ -115,6 +115,23 @@ var WindowMenu = class extends PopupMenu.PopupMenu { window.change_workspace(workspace.get_neighbor(dir)); }); } + + let { workspaceManager } = global; + let nWorkspaces = workspaceManager.n_workspaces; + if (nWorkspaces > 1 && !Meta.prefs_get_dynamic_workspaces()) { + item = new PopupMenu.PopupSubMenuMenuItem(_("Move to another workspace")); + this.addMenuItem(item); + + let currentIndex = workspaceManager.get_active_workspace_index(); + for (let i = 0; i < nWorkspaces; i++) { + let index = i; + let name = Meta.prefs_get_workspace_name(i); + let subitem = item.menu.addAction(name, () => { + window.change_workspace_by_index(index, false); + }); + subitem.setSensitive(currentIndex != i); + } + } } }