[gnome-shell-extensions/wip/fmuellner/window-list-scrolling: 2/2] window-list: Ignore hidden buttons when scrolling



commit b33762233e7d1195a8c360de18948ea324288fd4
Author: Florian Müllner <fmuellner gnome org>
Date:   Sat Oct 6 17:44:59 2018 +0200

    window-list: Ignore hidden buttons when scrolling
    
    Window lists are per-monitor, so workspaces are implemented by
    simply hiding all buttons that correspond to windows/apps on
    other workspaces. That means we need to take the visibility
    into account when handling scroll-events to switch through the
    list, or else we'll end up switching "randomly" between workspaces.
    
    https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/78

 extensions/window-list/extension.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/extensions/window-list/extension.js b/extensions/window-list/extension.js
index dd165af..b8ab37b 100644
--- a/extensions/window-list/extension.js
+++ b/extensions/window-list/extension.js
@@ -898,7 +898,9 @@ class WindowList {
         else
             return;
 
-        let children = this._windowList.get_children().map(a => a._delegate);
+        let children = this._windowList.get_children()
+            .filter(c => c.visible)
+            .map(a => a._delegate);
         let active = children.findIndex(c => c.active);
         let newActive = Math.max(0, Math.min(active + diff, children.length-1));
         children[newActive].activate();


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