Comment 9 for bug 703815

Revision history for this message
Panagiotis Skintzos (ph7) wrote :

Hi,
I don't think any of this is implementable, with the way libappindicator works.
With appindicator, any applet menu is parsed and served as the server side of a dbusmenu. The libapplication.so is the client side, which constructs regular gtk menus out of the served dbusmenu.

In the dbusmenu framework, the server side can declare the type of a menuitem as a custom type (apart from the regular, separator, image and toggle menuitems) and it's the client side's responsibility to declare that can can handle and create such a custom menuitem widget. This is the way libido is used from other indicators (datetime, sound etc) built outside of appindicator.

However in appindicator framework, there is no way to declare a custom menuitem in the server (indicator-application-service) and there is no way to create a custom menuitem in the client side (libapplication). It only knows & deals with standard menuitem types. It's not Python limitation, you cannot do it in C either.

What is needed to put custom menuitem widgets in the menu, is to leave appindicator behind and deal directly with libindicator and libdbusmenu. However you cannot do this in Python. The panel indicator placeholders load only modules from shared libraries installed currently in /usr/lib/indicators/4, which provide a subclass of an Indicator.Object.

I had an itch of putting custom widgets in my custom indicator applet, so I investigated this a lot and recoded my little Python applet to Vala. It took a while to get familiar with libdbusmenu and libindicator, but now I can happily put any custom widget I want in my menus.
Vadim, if you are interested in porting this indicator to Vala, I can help you out.