Skip to content

applets/showdesktop: Minimize All in LRU order

Christoph Wolk requested to merge cwo/plasma-desktop:minimize_fix into master

The Minimize all order currently walks through the windows in an unsorted manner and requests minimization of each applicable window. This can lead to a race condition if the order is unfortunate and the requested minimizing happens after the applet is set to active (and thus listening for windows that receieve focus). If focus is briefly passed to another window then, the list of minimized windows is cleared, and the minimized windows can no longer be restored by clicking the applet again.

This change makes the applet instead walk through the list in least recently used order, so that the window with focus is requested to minimize last, and therefore no other window receives focus briefly before it minimizes itself. This way, the ability to restore windows consistently works, rather than only sometimes.

I think this fixes BUG: 464785 but that issue is worded so confusingly that I'm not quite sure. I've done some testing and it seems to work very reliably now and I've found no negative consequences to not having the list be unsorted, but additional testing or insight would be appreciated.

Merge request reports