[Gambas-user] New system tray icon protocol support, new episode.

Adrien Prokopowicz adrien.prokopowicz at ...626...
Tue Jun 30 21:33:10 CEST 2015


Le Tue, 30 Jun 2015 12:09:17 +0200, Benoît Minisini
<gambas at ...1...> a écrit:

> Le 30/06/2015 04:30, Adrien Prokopowicz a écrit :
>> The only thing to note is that SNI only got implemented by Plasma in
>> KDE 4.5[0], so there is a case where gb.dbus.trayicon may get loaded
>> without a StatusNotifierHost being actually available.
>
> Ha! How to check that a StatusNotifierHost is present without loading
> the dbus component and calling any external process? :-/ The environment
> tells me the major version of the KDE desktop, but not its minor  
> version...

Well, I think the only reliable way to tell is to actually check the
session bus to see if the StatusNotifierHost is present.

What don't you like in having to load gb.dbus to do the check ?
I understand you don't want to load the component "for nothing" if
the check fails, but in some way it is also loaded whether or not
you are using TrayIcons in your programs, so ...

There are so many cases to test, I feel that if we somehow sort it out,
the whole environment-testing/dynamic-loading process would be
way cooler than the final TrayIcon feature itself. :)
(Not mentioning the work already done for that, i.e. the whole DBus
overhaul, and the "Optional Classes" interpreter feature, which
are both really cool).

> In the meantime I investigated with Unity... They actually use a DBus
> protocol completly different from the KDE one, but apparently QT apps
> using sni-qt (like vlc) know how to deal with that. I will try to look
> into the sni-qt source code to understand the magic behind that.
>
> Of course, don't expect to find any good documentation about that Unity
> protocol (a.k.a. libappindicator).
>

 From what I've saw in the sni-qt source code, it only relies on the
Unity-like protocol (which is also supported by KDE) :
the path sent to the StatusNotifierWatcher is hard-coded to be
"/org/kde/statusnotifieritem/<id>".

Also, if you need me to test some more things, just tell. :)

Regards,
-- 
Adrien Prokopowicz




More information about the User mailing list