Blame SOURCES/0001-appSwitcher-Add-option-to-limit-to-the-current-works.patch

13bb5b
From 4baaf4cccb723968637580e70ce1b6f4fcee1e39 Mon Sep 17 00:00:00 2001
13bb5b
From: Adel Gadllah <adel.gadllah@gmail.com>
13bb5b
Date: Thu, 4 Jul 2013 19:24:30 +0200
13bb5b
Subject: [PATCH] appSwitcher: Add option to limit to the current workspace
13bb5b
13bb5b
Add an option to limit the appSwitcher to the current workspace. For users
13bb5b
that use workspaces for task separation this more convient then current
13bb5b
behviour. While having to add an option is unfortunate there is no way to make
13bb5b
both groups happy as workspaces usage differes between different users / types
13bb5b
of users.
13bb5b
13bb5b
https://bugzilla.gnome.org/show_bug.cgi?id=703538
13bb5b
---
13bb5b
 data/org.gnome.shell.gschema.xml.in.in | 13 +++++++++++++
13bb5b
 js/ui/altTab.js                        |  9 +++++++--
13bb5b
 2 files changed, 20 insertions(+), 2 deletions(-)
13bb5b
13bb5b
diff --git a/data/org.gnome.shell.gschema.xml.in.in b/data/org.gnome.shell.gschema.xml.in.in
13bb5b
index 04d150c..81809d8 100644
13bb5b
--- a/data/org.gnome.shell.gschema.xml.in.in
13bb5b
+++ b/data/org.gnome.shell.gschema.xml.in.in
13bb5b
@@ -189,6 +189,19 @@ value here is from the GsmPresenceStatus enumeration.</_summary>
13bb5b
     </key>
13bb5b
   </schema>
13bb5b
 
13bb5b
+  
13bb5b
+          path="/org/gnome/shell/app-switcher/"
13bb5b
+          gettext-domain="@GETTEXT_PACKAGE@">
13bb5b
+    <key type="b" name="current-workspace-only">
13bb5b
+      <default>false</default>
13bb5b
+      <summary>Limit switcher to current workspace.</summary>
13bb5b
+      <description>
13bb5b
+	If true, only applications that have windows on the current workspace are shown in the switcher.
13bb5b
+	Otherwise, all applications are included.
13bb5b
+      </description>
13bb5b
+    </key>
13bb5b
+  </schema>
13bb5b
+
13bb5b
   <enum id="org.gnome.shell.window-switcher.AppIconMode">
13bb5b
     <value value="1" nick="thumbnail-only"/>
13bb5b
     <value value="2" nick="app-icon-only"/>
13bb5b
diff --git a/js/ui/altTab.js b/js/ui/altTab.js
13bb5b
index 34d83e4..9d47d1e 100644
13bb5b
--- a/js/ui/altTab.js
13bb5b
+++ b/js/ui/altTab.js
13bb5b
@@ -436,8 +436,11 @@ const AppSwitcher = new Lang.Class({
13bb5b
         this._arrows = [];
13bb5b
 
13bb5b
         let windowTracker = Shell.WindowTracker.get_default();
13bb5b
+        let settings = new Gio.Settings({ schema: 'org.gnome.shell.app-switcher' });
13bb5b
+        let workspace = settings.get_boolean('current-workspace-only') ? global.screen.get_active_workspace()
13bb5b
+                                                                       : null;
13bb5b
         let allWindows = global.display.get_tab_list(Meta.TabList.NORMAL,
13bb5b
-                                                     global.screen, null);
13bb5b
+                                                     global.screen, workspace);
13bb5b
 
13bb5b
         // Construct the AppIcons, add to the popup
13bb5b
         for (let i = 0; i < apps.length; i++) {
13bb5b
@@ -447,7 +450,9 @@ const AppSwitcher = new Lang.Class({
13bb5b
             appIcon.cachedWindows = allWindows.filter(function(w) {
13bb5b
                 return windowTracker.get_window_app (w) == appIcon.app;
13bb5b
             });
13bb5b
-            this._addIcon(appIcon);
13bb5b
+            if (workspace == null || appIcon.cachedWindows.length > 0) {
13bb5b
+                this._addIcon(appIcon);
13bb5b
+            }
13bb5b
         }
13bb5b
 
13bb5b
         this._curApp = -1;
13bb5b
-- 
13bb5b
2.1.0
13bb5b