Since Plasma Desktop 4.x is in long term maintenance mode, which means we're supposed to be making it more stable and reliable, I figured I'd spend a few minutes thinking about this problem. So I set aside one of my morning showers for this. Now you know what I do in the shower. Other than clean myself, of course. :) This probably explains my moderately frequent half-hour showers.
So ... exercise in problem solving time! Do we:
a) Always start Plasma Desktop in "Locked" mode?
Bad answer: it means that to do almost *anything* with your desktop you now need to unlock it. Many features become hidden and the user is robbed of discovery opportunities.
b) Lock just the panels!
Not only does (a) apply, but this introduces huge complexity .. and not just in the code (where now different containers need to be treated specially) but also for the poor end user who now has to figure out how to lock/unlock every freaking part of their desktop separately.
c) Allow the panel to tell the widgets when not to show their close item in the context menu. Then, when you click on the toolbox icon which gives you access to various configuration settings, have the panel tell the widgets that they should now show the remove item.
We have a winner!
Apparently it's not the most obvious idea in the world as people have been clamoring for (a) and/or (b) for some time and to my knowledge *nobody* has suggested (c). As a maintainer, my first job is to say "no" to ideas that will have undesirable side-effects. My rather less important second job is to identify (or in a worst-case-scenario, *gasp* come up with ;) ideas that will work .. or at least not fail. (The two are not always the same thing.)
I've been saying "no" to (a) and (b) for a while now, while suggesting that if someone can come up with a better idea, let me know. Well, it ended up in the shower and answer (c) was the result.
How much work would this be? One line in libplasma (checking a value) and three lines in the plasma-desktop shell (toggling that value in time to the configuration UI). Yes, a whopping four lines of code.
This demonstrates two things:
- Plasma is amazingly flexible and designed in such a way as to make implementing solutions to problems easy
- That the real work is often in realizing what the solution is in the first place