On 19/01/11 21:53, Julien Lavergne wrote:
> 2011/1/19 Julien Lavergne<julien.lavergne@...>:
>> 2011/1/19 Joost van der Hoff<2noob2banoob@...>:
>>> I am having a problem adding the standard LXPanel right-click dropdown
>>> menu the GlobalMenu plugin I am writing. Adding it to the plugin's top
>>> level container as in the example plugin doesn't work. I can add a
>>> mouseclick listener to the GlobalMenu widget but that overrides the
>>> listener which makes the GlobalMenu applet useful as a global menubar.
>>> Does anyone know how to add the right click dropdown menu without losing
>>> major functionality?
>> Try to remove any g_signal_connect to the top level container of the plugin.
>> From you example in the howto, try to remove :
>> g_signal_connect (G_OBJECT (p->pwid), "button_press_event", G_CALLBACK
>> (button_press_event), (gpointer) p);
>> It worked for me for my indicator plugin.
> Sorry, I posted too fast, it worked when I added more signals. I have this :
> g_signal_connect(p->pwid, "button-press-event",
> G_CALLBACK(plugin_button_press_event), p);
> g_signal_connect(indicator->menubar, "button-press-event",
> G_CALLBACK(menubar_press), NULL);
> g_signal_connect(indicator->menubar, "scroll-event", G_CALLBACK
> (menubar_scroll), NULL);
> g_signal_connect_after(indicator->menubar, "expose-event",
> G_CALLBACK(menubar_on_expose), indicator->menubar);
> where p->pwid is the top level plugin widget, and indicator->menubar
> the widget embedded into this top level plugin widget. I remembered
> that I had the same problem than you until I connect the signals of
> the indicator widget.
> Hope it will help.
> Julien Lavergne
I removed the handler from p->pwid, dunno if this has been a factor in
the solving. But the problem magically disappeared when I made my
callback function static. Problem solved :)
I have now also uploaded my source to
so if you are interested you can take a look at the source code and
maybe try if it works for you. You do however need the globalmenu-server
component of Gnome-GlobalMenu in order to compile and run the code.
There is also a bug in the Makefile generation causing the -lserver
argument to be passed to gcc, you should change this to -lglobalmenu-server.