D24044: MinimizeAll wrong behaviour

Vlad Zahorodnii noreply at phabricator.kde.org
Wed Sep 18 12:00:09 BST 2019


zzag added a reviewer: KWin.
zzag added a comment.


  What about simplifying it a bit as well? e.g.
  
    function minimizeAllWindows() {
        var allClients = workspace.clientList();
        var relevantClients = [];
        var minimize = false;
    
        for (var i = 0; i < allClients.length; ++i) {
            if (!isRelevant(allClients[i])) {
                continue;
            }
            if (!allClients[i].minimized) {
                minimize = true;
            }
            relevantClients.push(allClients[i]);
        }
    
        for (var i = 0; i < relevantClients.length; ++i) {
            var wasMinimizedByScript = relevantClients[i].minimizedByScript;
            delete relevantClients[i].minimizedByScript;
    
            if (minimize) {
                if (relevantClients[i].minimized) {
                    continue;
                }
                relevantClients[i].minimized = true;
                relevantClients[i].minimizedByScript = true;
            } else {
                if (!wasMinimizedByScript) {
                    continue;
                }
                relevantClients[i].minimized = false;
            }
        }
    }
  
  (I didn't test this script though)

REPOSITORY
  R108 KWin

REVISION DETAIL
  https://phabricator.kde.org/D24044

To: smerkov, colomar, #kwin
Cc: zzag, kwin, LeGast00n, The-Feren-OS-Dev, sbergeron, jraleigh, fbampaloukas, GB_2, mkulinski, ragreen, jackyalcine, iodelay, crozbo, bwowk, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, hardening, romangg, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwin/attachments/20190918/8f134a5f/attachment.html>


More information about the kwin mailing list