gnome-shell/SOURCES/0001-windowMenu-Bring-back-workspaces-submenu-for-static-.patch

46 lines
1.8 KiB
Diff
Raw Normal View History

2019-11-05 19:43:42 +00:00
From 20640a92f98e2145b9b6581209c978e9f6f78801 Mon Sep 17 00:00:00 2001
2019-05-07 12:23:00 +00:00
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Tue, 14 Mar 2017 17:04:36 +0100
Subject: [PATCH] windowMenu: Bring back workspaces submenu for static
workspaces
When the titlebar context menu was moved to the shell, the submenu for
moving to a specific workspace was intentionally left out; some people
are quite attached to it though, so bring it back when static workspaces
are used.
---
2019-11-05 19:43:42 +00:00
js/ui/windowMenu.js | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
2019-05-07 12:23:00 +00:00
diff --git a/js/ui/windowMenu.js b/js/ui/windowMenu.js
2019-11-05 19:43:42 +00:00
index 628f145ea..f8eb4398c 100644
2019-05-07 12:23:00 +00:00
--- a/js/ui/windowMenu.js
+++ b/js/ui/windowMenu.js
2019-11-05 19:43:42 +00:00
@@ -115,6 +115,23 @@ var WindowMenu = class extends PopupMenu.PopupMenu {
2019-05-07 12:23:00 +00:00
window.change_workspace(workspace.get_neighbor(dir));
});
}
+
2019-11-05 19:43:42 +00:00
+ let { workspaceManager } = global;
+ let nWorkspaces = workspaceManager.n_workspaces;
2019-05-07 12:23:00 +00:00
+ if (nWorkspaces > 1 && !Meta.prefs_get_dynamic_workspaces()) {
+ item = new PopupMenu.PopupSubMenuMenuItem(_("Move to another workspace"));
+ this.addMenuItem(item);
+
2019-11-05 19:43:42 +00:00
+ let currentIndex = workspaceManager.get_active_workspace_index();
2019-05-07 12:23:00 +00:00
+ 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);
+ }
+ }
}
}
--
2019-11-05 19:43:42 +00:00
2.21.0
2019-05-07 12:23:00 +00:00