[gnome-shell] windowManager: add switch-to-workspace-last keybinding



commit 4a6b89d44ce9030a0503de87040474b30011c1c6
Author: Elad Alfassa <elad fedoraproject org>
Date:   Sat May 18 20:55:05 2013 +0300

    windowManager: add switch-to-workspace-last keybinding
    
    When using dynamic workspace, the number of the last workspace may vary,
    and it would be nice to have a keybinding to jump directly to it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=659288

 js/ui/windowManager.js |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js
index bc43388..ae6a207 100644
--- a/js/ui/windowManager.js
+++ b/js/ui/windowManager.js
@@ -507,6 +507,10 @@ const WindowManager = new Lang.Class({
                                         Shell.KeyBindingMode.NORMAL |
                                         Shell.KeyBindingMode.OVERVIEW,
                                         Lang.bind(this, this._showWorkspaceSwitcher));
+        this.setCustomKeybindingHandler('switch-to-workspace-last',
+                                        Shell.KeyBindingMode.NORMAL |
+                                        Shell.KeyBindingMode.OVERVIEW,
+                                        Lang.bind(this, this._showWorkspaceSwitcher));
         this.setCustomKeybindingHandler('move-to-workspace-left',
                                         Shell.KeyBindingMode.NORMAL |
                                         Shell.KeyBindingMode.OVERVIEW,
@@ -607,6 +611,9 @@ const WindowManager = new Lang.Class({
         this.setCustomKeybindingHandler('move-to-workspace-12',
                                         Shell.KeyBindingMode.NORMAL,
                                         Lang.bind(this, this._showWorkspaceSwitcher));
+        this.setCustomKeybindingHandler('move-to-workspace-last',
+                                        Shell.KeyBindingMode.NORMAL,
+                                        Lang.bind(this, this._showWorkspaceSwitcher));
         this.setCustomKeybindingHandler('switch-applications',
                                         Shell.KeyBindingMode.NORMAL,
                                         Lang.bind(this, this._startAppSwitcher));
@@ -1208,7 +1215,10 @@ const WindowManager = new Lang.Class({
         let newWs;
         let direction;
 
-        if (isNaN(target)) {
+        if (target == 'last') {
+            direction = Meta.MotionDirection.DOWN;
+            newWs = screen.get_workspace_by_index(screen.n_workspaces - 1);
+        } else if (isNaN(target)) {
             direction = Meta.MotionDirection[target.toUpperCase()];
             newWs = screen.get_active_workspace().get_neighbor(direction);
         } else if (target > 0) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]