[gnome-shell] [AppSwitcher] Add a separator between windows in current and other workspaces.



commit dc232d4631b9d31200c89013625f1015a3b6e546
Author: Steve Frécinaux <code istique net>
Date:   Wed Oct 14 11:45:57 2009 +0200

    [AppSwitcher] Add a separator between windows in current and other workspaces.
    
    This make it is easier for the user to figure out on which workspace the
    windows are. For instance, terminals related to various activities and put on
    different workspaces were previously displayed as an uniform list, with no
    visible distinction between the ones from the current workspace and the others.
    Now they are physically separated by a thin gray line.
    
    This is also consistent with the way applications are displayed in the
    AppSwitcher.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=597944

 js/ui/altTab.js |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/altTab.js b/js/ui/altTab.js
index da4c996..a1a5f16 100644
--- a/js/ui/altTab.js
+++ b/js/ui/altTab.js
@@ -724,7 +724,19 @@ ThumbnailList.prototype = {
     _init : function(windows) {
         SwitcherList.prototype._init.call(this);
 
+        let activeWorkspace = global.screen.get_active_workspace();
+
+        // We fake the value of "separatorAdded" when the app has no window
+        // on the current workspace, to avoid displaying a useless separator in
+        // that case.
+        let separatorAdded = windows.length == 0 || windows[0].get_workspace() != activeWorkspace;
+
         for (let i = 0; i < windows.length; i++) {
+            if (!separatorAdded && windows[i].get_workspace() != activeWorkspace) {
+              this.addSeparator();
+              separatorAdded = true;
+            }
+
             let mutterWindow = windows[i].get_compositor_private();
             let windowTexture = mutterWindow.get_texture ();
             let [width, height] = windowTexture.get_size();



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