Summary: | [RFC] Should the minimize all script favor minimizing? | ||
---|---|---|---|
Product: | [Plasma] kwin | Reporter: | Thomas Lübking <thomas.luebking> |
Component: | general | Assignee: | KWin default assignee <kwin-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | CC: | blago37, nate, thomas.pfeiffer |
Priority: | NOR | ||
Version: | git master | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | https://commits.kde.org/kwin/fec0ab818d2460d2b2dd48e698eb2d48a2f1f0ab | Version Fixed In: | 5.17.0 |
Description
Thomas Lübking
2015-12-01 15:19:35 UTC
what about never restoring? Just having an easy way to minimize all windows? @Thomas P: what's your opinion. Though I'm the wrong Thomas, that would pretty much equal "prefer minimizing - minus loss of reasonable action when there's nothing to minimize, because we don't know what's reasonable here ;-)", would it not? yeah. My main problem with this is that I don't understand what users actually want. Which might even be impossible to know. Thank you for getting me involved. Guessing what an individual user wants can only be helpful if we know for a fact what the majority wants, and infer from this data that with a high probability, a given user X wants that. Since we have zero data on what the majority of users want with this script, we should not guess. Therefore, the script should do what it says on the tin: Minimize all, and nothing else. Nobody has the right to complain if a script doesn't do something which it never claims it does. So, as long as the script is called "Minimize all windows", it should do nothing but that. If we think it might be useful o have the same script restore all windows if it's invoked immediately again, it should be called "Minimize/restore all". A script which minimizes windows that are not minimized, but restores minimized windows at the same time (which te script does now, if I understood Thomas' description correctly) does not sound very useful to me in the first place. What would be the usecase for that? (In reply to Thomas Pfeiffer from comment #5) > What would be the usecase for that? Bug #67406 :-P Basically, a bunch of users didn't like how ShowDesktop behaved (when some window was brought to screen, all windows restored, because "show desktop" is meant modal - it's not a way to unclutter the desktop) and Lubos added a secret key to make it behave like that (to spare him endless discussions ;-) When we altered the "show desktop" implementation to raise the desktop rather than to unmap ("minimize") all windows, the script was added as compensation, since the key could obviously no longer be used (while unmapping windows, this was merely a check on "what do I do if a window appears", but now it's an entirely different process) The name "minimize all" stems from there; the legacy behavior seems to have been: If there is something to minimize, do that, otherwise restore what was minimized on last invocation. The script presently strictly toggles (ie. as long as there's something been minimized by the script, it will unminimize all those windows rather than minimizing new ones) - mostly because I implemented it "free handed". > A script which minimizes windows that are not minimized, but restores minimized windows at the same time This does not happen. It either minimizes XOR restores everything. The quarrel is on "when do we do what" - we do not flip minimization (for that would *really* just be virtual desktops ;-) PS: I'm fine with throwing random modifications at the users and shipping all alternatives via GHNS. If there had not been this <*censored*> <*censored*> <*really?? you kiss your mom with that mouth? - censored!*> config key, the script would not be part of the KWin installation anyway. Aaaah, okay, now I understand what it does atm, I had missed the "what it has minimized" part. I agree with you, then: It should only un-minimize anything if it is activated again immediately without any further minimizing or unminimizing happening in-between. The main function is minimizing (as the name suggests), the un-minimize function serves only as an "undo" function. (In reply to Thomas Pfeiffer from comment #8) > serves only as an "undo" function. "Undo" would support to only restore the windows minimized in the last positive invocation (and ignore all windows formerly minimized by the script)? (In reply to Thomas Lübking from comment #9) > "Undo" would support to only restore the windows minimized in the last > positive invocation (and ignore all windows formerly minimized by the > script)? That's what I'd expect, yes. But honestly, it would just be a bonus. the only thing that the script needs to accomplish is minimizing all windows. If one can reverse the action by executing it again, that's nice, but it cannot be expected. Git commit 8885a6798a348cc709a3423f37593cc3f6ce6eee by Thomas Lübking. Committed on 08/12/2015 at 20:08. Pushed by luebking into branch 'master'. 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. FIXED-IN: 5.6 REVIEW: 126225 M +7 -4 scripts/minimizeall/contents/code/main.js http://commits.kde.org/kwin/8885a6798a348cc709a3423f37593cc3f6ce6eee (In reply to Thomas Lübking from comment #11) > 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. Sorry for my english. Current code does not fulfill these duties. Try next case: run minimizeall on some windows, then click on one of windows, then run minimizeall again. All windows would be unminimized! I have tried to make small changes to original code of main.js, but i can't because i don't understand it. Thats why i wrote my own version. Sorry for my english again. var minimizeAllWindows = function() { var allClients = workspace.clientList(); var clients = []; var minimize = false; for (var i = 0; i < allClients.length; ++i) { if (isRelevant(allClients[i])) { clients.push(allClients[i]); if (!allClients[i].minimized) { minimize = true; } } } if (minimize == true) { for (var i = 0; i < clients.length; ++i) { delete clients[i].minimizedForMinimizeAll; if (clients[i].minimized == true) { continue; } else { clients[i].minimized = true; clients[i].minimizedForMinimizeAll = true; } } } else { for (var i = 0; i < clients.length; ++i) { if (clients[i].minimizedForMinimizeAll == true) { clients[i].minimized = false; } } } clients = []; } @Anton Would you like to submit a patch? https://community.kde.org/Get_Involved/development#Submit_a_patch (In reply to Vlad Zahorodnii from comment #13) > @Anton Would you like to submit a patch? After your suggestion i made it. https://phabricator.kde.org/D24044 Git commit fec0ab818d2460d2b2dd48e698eb2d48a2f1f0ab by Vlad Zahorodnii, on behalf of Anton Smerkov. Committed on 18/09/2019 at 15:11. Pushed by vladz into branch 'master'. Emphasize minimization in MinimizeAll script Summary: MinimizeAll should work as follows: > As long as there's something to minimize, do that. > Otherwise unminimize only the windows we minimized > on last invocation. Quote above is from Comment 11 by Thomas Lübking of BUG: 356161. But current code does not fulfill these duties. Try next case: run minimizeall on some windows, then click on one of windows, then run minimizeall again. All windows would be unminimized! I have tried to make small changes to original code of main.js, but i can't because i don't understand it. Thats why i wrote my own version. Then i changed my version to version of zzag, because his code is more simple. I have tested both versions. Reviewers: colomar, #kwin, zzag Reviewed By: #kwin, zzag Subscribers: romangg, zzag, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D24044 M +25 -15 scripts/minimizeall/contents/code/main.js https://commits.kde.org/kwin/fec0ab818d2460d2b2dd48e698eb2d48a2f1f0ab |