[gnome-shell/wip/rstrode/rhel-7.9: 32/86] windowMenu: Bring back workspaces submenu for static workspaces
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/rstrode/rhel-7.9: 32/86] windowMenu: Bring back workspaces submenu for static workspaces
- Date: Fri, 12 Feb 2021 19:04:06 +0000 (UTC)
commit e3575a861958b8fe9b2249ed3815645d74df81e5
Author: Florian Müllner <fmuellner gnome org>
Date: Tue Mar 14 17:04:36 2017 +0100
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.
js/ui/windowMenu.js | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
---
diff --git a/js/ui/windowMenu.js b/js/ui/windowMenu.js
index f0e564b7ec..8c97a1eec0 100644
--- a/js/ui/windowMenu.js
+++ b/js/ui/windowMenu.js
@@ -123,6 +123,22 @@ var WindowMenu = new Lang.Class({
window.change_workspace(workspace.get_neighbor(dir));
});
}
+
+ let nWorkspaces = global.screen.n_workspaces;
+ if (nWorkspaces > 1 && !Meta.prefs_get_dynamic_workspaces()) {
+ item = new PopupMenu.PopupSubMenuMenuItem(_("Move to another workspace"));
+ this.addMenuItem(item);
+
+ let currentIndex = global.screen.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);
+ }
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]