gnome-shell/0001-windowMenu-Bring-back-workspaces-submenu-for-static-.patch
Florian Müllner b1227a1d04
Re-apply downstream patches
Not all patches have been upstreamed, so re-apply the changes from
RHEL 9 that are still relevant.

Downstream branding will be different in RHEL 10, so it has been
left out for now and will be handled in a separate issue.

Resolves: RHEL-32989
2024-04-16 20:51:39 +02:00

46 lines
1.8 KiB
Diff

From 5eaadd46539a9f6154bc32e87a6c50b420349768 Mon Sep 17 00:00:00 2001
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.
---
js/ui/windowMenu.js | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/js/ui/windowMenu.js b/js/ui/windowMenu.js
index 571a193580..76d630911a 100644
--- a/js/ui/windowMenu.js
+++ b/js/ui/windowMenu.js
@@ -159,6 +159,23 @@ export class WindowMenu extends PopupMenu.PopupMenu {
window.change_workspace(workspace.get_neighbor(dir));
});
}
+
+ let { workspaceManager } = global;
+ let nWorkspaces = workspaceManager.n_workspaces;
+ if (nWorkspaces > 1 && !Meta.prefs_get_dynamic_workspaces()) {
+ item = new PopupMenu.PopupSubMenuMenuItem(_("Move to another workspace"));
+ this.addMenuItem(item);
+
+ let currentIndex = workspaceManager.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);
+ }
+ }
}
}
--
2.44.0