another update on the systray and tiny api review

Marco Martin notmart at gmail.com
Wed Mar 18 13:59:42 CET 2009


yo chaps,
situation of the new systemtry protocol stuff...
it basically works, also the client library that is in 
playground/base/plasma/libknotificationicon and supports all it was on the 
whiteboard :p
there are however still some issues that must be cleared. this mail talks just 
about the client library, the systray plasmoid part in a future moment, to not 
make even more confusion :D.

there are two classes, knotificationicon that i did mostly just to see if the 
ksystemtrayicon api was remotely useful for what we need and 
kdbussystemtrayicon that is the actual working thing where i didn't look the 
old api that much..
so:
the ksystemtrayicon api is not really adapt for several reasons:

-setMovie() we are on dbus now, sending the binary data is already expensive 
enough

-geometry() a thing that is purposefully removed from the spec, i.e the app 
shouldn't know nothing about the real graphical representation

-icon/setIcon(): now there are two kinds, setIconName, the preferred way, in 
this case the real icon loading will be done by the systray with KIcon() and 
setIconPixmap, that sets an actual pixmap and sends over dbus the bytearray 
representation of the corresponding qimage (yeah, really expensive) so even 
setIcon(QIcon) isn't really an option (yeah, the different sizes could even be 
somehow serialized, but oh boy...)

-loadIcon: made pretty much useless by setIconName

-setToolTip: it's a simple string, so has to be replaced with several 
functions  settooltiptitle/subtitle/icon

-parentWidgetTrayClose apart from the fact that i still didn't get exactly 
what the thing does is perhaps a thing a bit too specialized for the current 
systemtray implementation?

-setContextMenuTitle: seems an implementation detail not really useful? the 
contextmenu is accessible anyways...

Things that i'm thinking about to implement:
-parentWidget and actionCollection, again implementation details that i wonder 
if they are really useful

-showMessage a shortcut for knotify? does really belongs here? probably the 
pplication should just use knotify...

A problem i'm having is the contextmenu placement, right now the applet asks 
the contextMenu(x,y) function asking coordinates, but it gets a bit misplaced 
(i suppose because the menu can't have a proper parent widget positioned where 
the systray icon is) so something else would be needed? only the applet knows 
how to position the context menu correctly, so i tought about making the 
function contextMenu with no parameters and returning the window id of the 
menu (ouch!) so the applet can manually reposition the thing.. is it too ugly?

after defining those points i think ill rename the thing again to 
libknotificationicon and could be tought about moving the thing out of 
playground (for 4.3 still not to kdelibs? workspace or runtime for a limited 
testing perhaps?)

What do you think?

Cheers,
Marco Martin


More information about the Plasma-devel mailing list