Panel Update
Jasper Huijsmans
jasper at xfce.org
Sat Sep 10 09:02:26 CEST 2005
Brian J. Tarricone schreef:
...
>>
>>So, if you have any comments about this API, please let me know now,
>>before people have started to port any plugins.
>
>
> Like Benny said, I don't see the need for xfce_panel_plugin_set_data()
> and xfce_panel_plugin_get_data(). GObject provides these, and having
> another function that does the same thing is redundant and confusing.
>
Confusing, really? In that case I should remove it. I thought it was
rather harmless and a bit of a pointer to plugin writers of what to do
with their private plugin data...
> I'm a little confused as to what xfce_panel_plugin_add_action_widget() does:
>
> "Attach the plugin menu to this widget. Plugin writers should call this
> for every widget that can receive mouse events."
>
> Does this replace the old "attach_callback" thingy in the old panel? Or
> is this do something else?
>
It's exactly that. Any suggestion that make it more clear?
> Also a nitpick on the implementation of
> XFCE_PANE_PLUGIN_REGISTER_EXTERNAL(). You connect the 'destroy' signal
> to gtk_main_quit(). I'd suggest just connecting it to exit(). The
> reasoning here is that if the plugin has another mainloop running at
> that time (perhaps via gtk_dialog_run()), then gtk_main_quit() will only
> quit that inner mainloop, and not the outer.
>
> Another issue with that is allowing the plugin to catch destruction.
> Since glib can't guarantee callback order, if the plugin itself hooks
> 'destroy', it might never get the signal. (Well, ok, in your method it
> does, but not in mine where you call exit().) I'd suggest changing that
> to g_signal_connect_after().
>
> Actually, you can eliminate both problems by declaring a helper
> function, and then doing:
>
> while(gtk_main_level())
> gtk_main_quit();
>
> I think. Or maybe you have to do a for loop. I don't remember if
> gtk_main_quit() immediately decrements the main level, or if it only
> does it after gtk_main() or gtk_dialog_run() actually returns.
>
> Anyway, just a few random things off the top of my head...
>
Ok, yes, I wasn't exactly happy with that myself. I'm fine with exit(),
that should just work, isn't it? The only thing that's still happening
is that when the panel crashes, external plugins keep running.
I want the wrapper macro for external plugins to make sure the plugin
functions are only used after the plug has been embedded into the panel,
which is needed for the X client message communication.
Like I said, suggestions for alternatives are welcome. I do really like
the fact that writing external plugins is just the same as writing
internal plugins. At the very least it shouldn't be harder.
Jasper
More information about the Xfce4-dev
mailing list