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

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