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