From d4a2f9e6042ac744bf47b74aaeaea16c24fd1026 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Sat, 26 Sep 2009 10:59:21 -0400 Subject: [PATCH] [AppIcon] Sort minimized windows after normal ones in AppIcon menu https://bugzilla.gnome.org/show_bug.cgi?id=596389 --- js/ui/appIcon.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/js/ui/appIcon.js b/js/ui/appIcon.js index b5d81932b..eb08eae4a 100644 --- a/js/ui/appIcon.js +++ b/js/ui/appIcon.js @@ -160,13 +160,15 @@ AppIcon.prototype = { _resortWindows: function() { this.windows.sort(function (a, b) { - let timeA = a.get_user_time(); - let timeB = b.get_user_time(); - if (timeA == timeB) - return 0; - else if (timeA > timeB) + let visA = a.showing_on_its_workspace(); + let visB = b.showing_on_its_workspace(); + + if (visA && !visB) return -1; - return 1; + else if (visB && !visA) + return 1; + else + return b.get_user_time() - a.get_user_time(); }); },