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

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