Blame SOURCES/0001-alternateTab-Adjust-to-gnome-shell-changes.patch

71b11d
From e98e5d0d6232da905bfec8023fc8ef557893b77d Mon Sep 17 00:00:00 2001
71b11d
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
71b11d
Date: Tue, 31 May 2016 17:12:20 +0200
71b11d
Subject: [PATCH] alternateTab: Adjust to gnome-shell changes
71b11d
71b11d
The code de-duplication in commit bf8d30603e57b broke the extension,
71b11d
fix by duplicating the code here now :-(
71b11d
71b11d
(It's not really that bad though ...)
71b11d
71b11d
https://bugzilla.gnome.org/show_bug.cgi?id=767077
71b11d
---
71b11d
 extensions/alternate-tab/extension.js | 29 +++++++++++++++++++++--------
71b11d
 1 file changed, 21 insertions(+), 8 deletions(-)
71b11d
71b11d
diff --git a/extensions/alternate-tab/extension.js b/extensions/alternate-tab/extension.js
71b11d
index 79fde0a..7a5ee17 100644
71b11d
--- a/extensions/alternate-tab/extension.js
71b11d
+++ b/extensions/alternate-tab/extension.js
71b11d
@@ -7,6 +7,7 @@ const Shell = imports.gi.Shell;
71b11d
 
71b11d
 const AltTab = imports.ui.altTab;
71b11d
 const Main = imports.ui.main;
71b11d
+const WindowManager = imports.ui.windowManager;
71b11d
 
71b11d
 let injections = {};
71b11d
 
71b11d
@@ -33,20 +34,32 @@ function enable() {
71b11d
         return injections['_keyPressHandler'].call(this, keysym, action);
71b11d
     };
71b11d
 
71b11d
-    setKeybinding('switch-applications', Lang.bind(Main.wm, Main.wm._startWindowSwitcher));
71b11d
-    setKeybinding('switch-group', Lang.bind(Main.wm, Main.wm._startWindowSwitcher));
71b11d
-    setKeybinding('switch-applications-backward', Lang.bind(Main.wm, Main.wm._startWindowSwitcher));
71b11d
-    setKeybinding('switch-group-backward', Lang.bind(Main.wm, Main.wm._startWindowSwitcher));
71b11d
+    Main.wm._forcedWindowSwitcher = function(display, screen, window, binding) {
71b11d
+        /* prevent a corner case where both popups show up at once */
71b11d
+        if (this._workspaceSwitcherPopup != null)
71b11d
+            this._workspaceSwitcherPopup.destroy();
71b11d
+
71b11d
+        let tabPopup = new AltTab.WindowSwitcherPopup();
71b11d
+
71b11d
+        if (!tabPopup.show(binding.is_reversed(), binding.get_name(), binding.get_mask()))
71b11d
+            tabPopup.destroy();
71b11d
+    };
71b11d
+
71b11d
+    setKeybinding('switch-applications', Lang.bind(Main.wm, Main.wm._forcedWindowSwitcher));
71b11d
+    setKeybinding('switch-group', Lang.bind(Main.wm, Main.wm._forcedWindowSwitcher));
71b11d
+    setKeybinding('switch-applications-backward', Lang.bind(Main.wm, Main.wm._forcedWindowSwitcher));
71b11d
+    setKeybinding('switch-group-backward', Lang.bind(Main.wm, Main.wm._forcedWindowSwitcher));
71b11d
 }
71b11d
 
71b11d
 function disable() {
71b11d
     var prop;
71b11d
 
71b11d
-    setKeybinding('switch-applications', Lang.bind(Main.wm, Main.wm._startAppSwitcher));
71b11d
-    setKeybinding('switch-group', Lang.bind(Main.wm, Main.wm._startAppSwitcher));
71b11d
-    setKeybinding('switch-applications-backward', Lang.bind(Main.wm, Main.wm._startAppSwitcher));
71b11d
-    setKeybinding('switch-group-backward', Lang.bind(Main.wm, Main.wm._startAppSwitcher));
71b11d
+    setKeybinding('switch-applications', Lang.bind(Main.wm, Main.wm._startSwitcher));
71b11d
+    setKeybinding('switch-group', Lang.bind(Main.wm, Main.wm._startSwitcher));
71b11d
+    setKeybinding('switch-applications-backward', Lang.bind(Main.wm, Main.wm._startSwitcher));
71b11d
+    setKeybinding('switch-group-backward', Lang.bind(Main.wm, Main.wm._startSwitcher));
71b11d
 
71b11d
     for (prop in injections)
71b11d
         AltTab.WindowSwitcherPopup.prototype[prop] = injections[prop];
71b11d
+    delete Main.wm._forcedWindowSwitcher;
71b11d
 }
71b11d
-- 
71b11d
2.7.4
71b11d