So today I sat down and went to work on panel autohiding. Short story: you can now hide your panels. Feel free to do a little dance, make a little love. You know the drill.
In KDE3 kicker had two really annoying attributes when it came to panel hiding: it polled for the mouse cursor and it actually moved the whole top level window around on screen. "So what?" you say.
Well, the polling meant that whenever a panel was autohidden, kicker would wake up 10 times a second and ask the window system, "Hey, where's the cursor now?" If it was along any edge or corner, it would emit a signal that hidden panels would be listening to. Not only was this mildly inefficient just due to the polling and what not, it meant that when kicker wasn't on your screen it was (ironically) waking up your CPU a lot. Not great for power consumption, but hey, at least it was all the way off the screen right?
Moving the actual window around was a problem because moving a window isn't exactly cheap. It's less expensive than resizing the window, though: that involves allocating a new buffer for the new size of the window, blitting the contents into that and then freeing the old buffer. So instead of resizing, kicker moved the window. Not perfect, but reasonably efficient enough that it works even on low end systems. All is great .. until you put more than one screen on your computer and a panel "in between" them. Then when the window moved off of one screen (pretending to hide) it would just move onto the other one. Whoops!
So I took a completely different approach with Plasma. Now we move the contents inside the panel window to animate hiding, which means it works even on multiscreen systems, and we use something called an "input only window" to trigger the unhide. An input only window doesn't paint anything to screen, but does let us get input events. When a panel hides, we create a teeny tiny little input only window and when we get an enter event, pop goes the panel. Voila, no more polling and therefore no more waking up the CPU ten times a second.
Now the bad news:
If you don't have a compositing window manager you don't get any animations. The panel just appears and disappears. This is because to do the move-the-contents trick and make it look convincing, the panel window background needs to be transparent and we have a policy in Plasma: no stupid tricks like fake transparency. If you want bling, you need to use the right tools.
I also haven't done the configuration UI for this feature yet, but it'll be there soon so those of you using KDE from trunk don't need to fiddle with your configuration files.
There's also a problem I've run into with some "interesting" optimizations that QAbstractScrollArea makes in painting that results in some white-blink. I may have to make some minor alterations to get it to work exactly the way I want.
I also haven't implemented "prevent hiding when a menu or something else like that is showing". So if you pop up, say, the kickoff menu the panel will hide when you go over it. It's not a big deal, and I'll fix this tomorrow along with some of the other rough edges.
Oh, I also implemented the windows-can-cover-the-panel option. Ta-da.