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

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