[gnome-shell] altTab: Improve cycling to a window on another workspace



commit a029a3505039de17e0b4fa7593e825a079d115a9
Author: Florian Müllner <fmuellner gnome org>
Date:   Wed Sep 14 22:44:12 2016 +0200

    altTab: Improve cycling to a window on another workspace
    
    Both 'cycle-group' and 'cycle-window' shortcuts allow cycling through
    windows on all workspaces. While this works, it looks quite broken
    since we started showing clones for highlighting: the selected window
    vanishes (when its clone is destroyed), then slides back in with its
    workspace. Instead, slide the selected window to its workspace like
    we do for the 'move-to-workspace-*' shortcuts.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=771536

 js/ui/altTab.js |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/altTab.js b/js/ui/altTab.js
index c221707..27aa2d7 100644
--- a/js/ui/altTab.js
+++ b/js/ui/altTab.js
@@ -444,7 +444,21 @@ const CyclerPopup = new Lang.Class({
     },
 
     _finish: function() {
-        Main.activateWindow(this._items[this._selectedIndex]);
+        let window = this._items[this._selectedIndex];
+        let ws = window.get_workspace();
+        let activeWs = global.screen.get_active_workspace();
+
+        if (activeWs == ws) {
+            Main.activateWindow(window);
+        } else {
+            // If the selected window is on a different workspace, we don't
+            // want it to disappear, then slide in with the workspace; instead,
+            // always activate it on the active workspace ...
+            activeWs.activate_with_focus(window, global.get_current_time());
+
+            // ... then slide it over to the original workspace if necessary
+            Main.wm.actionMoveWindow(window, ws);
+        }
 
         this.parent();
     },


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