Blob Blame History Raw
From cda4c58cfa094c44fe939f050ef1113fdd88c8ba Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Thu, 30 Jul 2015 14:45:58 +0200
Subject: [PATCH] window-list: Don't consider skip-taskbar windows for app
 sorting

It is odd to consider windows that are not shown in the window list
for app sorting, in particular when switching between grouped and
ungrouped mode, and when a long-lived window like the DESKTOP is
present.

https://bugzilla.gnome.org/show_bug.cgi?id=753055
---
 extensions/window-list/extension.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/extensions/window-list/extension.js b/extensions/window-list/extension.js
index 28feda6..f37c850 100644
--- a/extensions/window-list/extension.js
+++ b/extensions/window-list/extension.js
@@ -58,7 +58,8 @@ function _onMenuStateChanged(menu, isOpen) {
 }
 
 function _getAppStableSequence(app) {
-    return app.get_windows().reduce(function(prev, cur) {
+    let windows = app.get_windows().filter(function(w) { return !w.skip_taskbar; });
+    return windows.reduce(function(prev, cur) {
         return Math.min(prev, cur.get_stable_sequence());
     }, Infinity);
 }
-- 
2.4.3