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