XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL

Jasper Huijsmans jasper at xfce.org
Mon Sep 26 08:29:39 CEST 2005


Hi Erik,

Nice subject line. I was thinking: "who the f* is shouting at the ML 
like that... oh, wait, never mind..." ;-)

Erik Harrison schreef:
> For the new panel, is it necessary to have the plugin author drag in
> all of stdlib just to get exit()? Wouldn't it be better to simply
> gtk_main_quit() and fall off of main()? Something like
> 
> void xfce_panel_plugin_exit () {
>     while (gtk_main_level()) {
>         gtk_main_quit();
> }
> 
> and register that as the callback instead of exit().
> 

Fine with me.

> The only advantage I see to using exit directly is that the plugin
> author can register stuff to run atexit - but that's a little hacky to
> me anyway, since it doesn't work for internal plugins. A "finalize"
> signal or similar might be better - which could eliminate the loop
> with gtk_main_level by giving plugin authors the chance to kill any
> additional mainloops themselves, and just use gtk_main_quit() as the
> callback directly.

Hmm, yeah, the plugin author could connect to the destroy signal if I 
connect the gtk_main_quit() with g_signal_connect_after (). Sounds 
reasonable.

Any other comments suggestions?

Actualy, I don't feel entirely comfortable with doing all this work in 
the macro. Alternatively, I could change it to be run from inside main 
by the plugin authors themselves.

   XFCE_PANEL_REGISTER_EXTERNAL_PLUGIN (contruct, argc, argv);

Any opinions on this?

	Jasper



More information about the Xfce4-dev mailing list