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

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