|
|
1bd53d |
From 34a7bfdade939e39c2a01cc1b0737a7bdccddd5b Mon Sep 17 00:00:00 2001
|
|
|
1bd53d |
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
|
|
|
1bd53d |
Date: Tue, 14 Mar 2017 17:04:36 +0100
|
|
|
1bd53d |
Subject: [PATCH] windowMenu: Bring back workspaces submenu for static
|
|
|
1bd53d |
workspaces
|
|
|
1bd53d |
|
|
|
1bd53d |
When the titlebar context menu was moved to the shell, the submenu for
|
|
|
1bd53d |
moving to a specific workspace was intentionally left out; some people
|
|
|
1bd53d |
are quite attached to it though, so bring it back when static workspaces
|
|
|
1bd53d |
are used.
|
|
|
1bd53d |
---
|
|
|
1bd53d |
js/ui/windowMenu.js | 17 +++++++++++++++++
|
|
|
1bd53d |
1 file changed, 17 insertions(+)
|
|
|
1bd53d |
|
|
|
1bd53d |
diff --git a/js/ui/windowMenu.js b/js/ui/windowMenu.js
|
|
|
1bd53d |
index bb6a8df7b..3449f759d 100644
|
|
|
1bd53d |
--- a/js/ui/windowMenu.js
|
|
|
1bd53d |
+++ b/js/ui/windowMenu.js
|
|
|
1bd53d |
@@ -116,6 +116,23 @@ var WindowMenu = class extends PopupMenu.PopupMenu {
|
|
|
1bd53d |
window.change_workspace(workspace.get_neighbor(dir));
|
|
|
1bd53d |
});
|
|
|
1bd53d |
}
|
|
|
1bd53d |
+
|
|
|
1bd53d |
+ let { workspaceManager } = global;
|
|
|
1bd53d |
+ let nWorkspaces = workspaceManager.n_workspaces;
|
|
|
1bd53d |
+ if (nWorkspaces > 1 && !Meta.prefs_get_dynamic_workspaces()) {
|
|
|
1bd53d |
+ item = new PopupMenu.PopupSubMenuMenuItem(_("Move to another workspace"));
|
|
|
1bd53d |
+ this.addMenuItem(item);
|
|
|
1bd53d |
+
|
|
|
1bd53d |
+ let currentIndex = workspaceManager.get_active_workspace_index();
|
|
|
1bd53d |
+ for (let i = 0; i < nWorkspaces; i++) {
|
|
|
1bd53d |
+ let index = i;
|
|
|
1bd53d |
+ let name = Meta.prefs_get_workspace_name(i);
|
|
|
1bd53d |
+ let subitem = item.menu.addAction(name, () => {
|
|
|
1bd53d |
+ window.change_workspace_by_index(index, false);
|
|
|
1bd53d |
+ });
|
|
|
1bd53d |
+ subitem.setSensitive(currentIndex != i);
|
|
|
1bd53d |
+ }
|
|
|
1bd53d |
+ }
|
|
|
1bd53d |
}
|
|
|
1bd53d |
}
|
|
|
1bd53d |
|
|
|
1bd53d |
--
|
|
|
1bd53d |
2.31.1
|
|
|
1bd53d |
|