So far the total diff is +47 -42 lines: a sum total of five new lines of code. For those lines of code we get a couple new features, including being able to tell the system tray that we are a hardware related item and that we're currently active.
The first neat thing I noticed when it appeared in the system tray was that it behaved like all the other icons: it glowed when it was hovered over, it grew smaller when it was pressed. It suddenly felt a lot more like it belonged with the rest of the things on the panel down there. It wasn't some odd alien anymore.
(Which reminds me: in 4.3 when you press on Plasma::IconWidgets the "get smaller" as if you are "pressing them into the canvas and therefore receding away". It's the same kind of effect I put into kicker back in .. oh .. 3.3? 3.4? Something like that .. anyways, it gives some nice "tactile" feedback for those icon buttons. Anyways, back to the system tray stuff .... )
The coolest thing, however, was when I started a second system tray using plasmoidviewer: now I had two trays in two different processes ... and the KMix icon showed up in both. None of the other icons did, of course. One more step towards closing a feature wish I first came upon years and years ago for Kicker: to have multiple trays for multiscreen systems. :)
The DBus protocol behind all this had all the wiring in place for stuff like wheel event notification, but not all of it wasn't plugged together in the actual system tray code. So I went off and did that bit of ankle-bone's-connected-to-the-mouse-wheel-bone work and there was wheeling goodness again in the KMix icon. Great!
There are still a few small things to take care of, like making the DBus calls on the system tray plasmoid side non-blocking so we don't end up freezing the whole of plasma-desktop due to a misbehaving app on the other side (the wheel event call is already non-blocking since I just put that one in there, but the others are synchronous), figuring out what kind of geometry information we want to pass back for main window activation (kmix likes to position it's slider popup using this information) and couple other minor points.
A current assessment of KNotificationAreaIcon is that it's a really long name but it works right out of the box, including with xembed-only system tray environments, with only a few minor (though quite fixable) caveats at the moment. It needs some tweaking and polishing, but it should be in great order before 4.3.0 given it's current state.
Support for this on the Plasma side is already in svn for 4.3, but we're planning and plotting how to go about the application side. Our current strategy is this:
- Port a couple of KDE applications to the new application side API, KNotificationAreaItem, to prove and stress the current system and APIs, fixing bugs and implementing needed features as they crop up. I've already done KMix, but we're looking for a couple more to join the game. Come find us in #plasma on irc if you'd like to try it out in your application, or just take a look in playground/base/plasma/libknotificationareaitem and figure it out on your own. :)
- Write up a detailed spec and put that on Techbase as documentation for the DBus interaction bits.
- Take it all to kde-core-devel for comment and hopefully approval for kdelibs. My personal goal is to have it in KDE 4.4's libs. I'm not sure we can (or should) make it in for 4.3: we can port select apps using a small helper lib for 4.3 that doesn't have the BC guarantees that kdelibs caries. We could perhaps install it as a static lib even that apps just "suck in" to avoid any BC issues of any sort. If there's both comfort and demand for this, we can put it into 4.3's kdelibs .. but we've lived with the current situation for years and years, another 6 months limping along with a static lib won't kill us. ;) In return we'll get good usage info and be able to modify the API or DBus service as needed.
- Assuming it goes well on kde-core-devel, then we will take it to freedesktop.org.
- Have some icecream, watch the lilies grow in the field
- Fast forward a few years to a time when we no longer have any of this xembed crap to deal with in the tray anymore.
Happy days are here again.