From 8885a6798a348cc709a3423f37593cc3f6ce6eee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Wed, 2 Dec 2015 22:37:20 +0100 Subject: [PATCH] emphasize minimization in m. all script As long as there's something to minimize, do that. Otherwise unminimize only the windows we minimized on last invocation. BUG: 356161 FIXED-IN: 5.6 REVIEW: 126225 --- scripts/minimizeall/contents/code/main.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/minimizeall/contents/code/main.js b/scripts/minimizeall/contents/code/main.js index 30b26b2be8..a8e17e8000 100644 --- a/scripts/minimizeall/contents/code/main.js +++ b/scripts/minimizeall/contents/code/main.js @@ -27,18 +27,21 @@ function isRelevant(client) { var minimizeAllWindows = function() { var allClients = workspace.clientList(); var clients = []; - var minimize = true; + var minimize = false; for (var i = 0; i < allClients.length; ++i) { if (isRelevant(allClients[i])) { clients.push(allClients[i]); - if (allClients[i].minimizedForMinimizeAll === true) { - minimize = false; + if (!allClients[i].minimized && allClients[i].minimizedForMinimizeAll !== true) { + minimize = true; } } } for (var i = 0; i < clients.length; ++i) { - if (minimize && clients[i].minimized) + if ((minimize == clients[i].minimized) || // no change required at all + (!minimize && clients[i].minimizedForMinimizeAll !== true)) { // unminimize, but not this one + delete clients[i].minimizedForMinimizeAll; continue; + } clients[i].minimized = minimize; clients[i].minimizedForMinimizeAll = minimize; }