Questions about xfdesktop's menu plugin
Diego Ongaro
ongardie at gmail.com
Sat Apr 21 01:17:47 CEST 2007
Thanks Jasper. For the purposes of the places plugin, I'm satisfied
with my responses. Here's a summary of the results:
1. Brian believes this is a benign bug. I don't think anyone's concerned.
2. Based on Jasper's response, I've opened this bug to alter the
panel's documentation: http://bugzilla.xfce.org/show_bug.cgi?id=3166 .
3. For the places plugin, I've avoided the extra work. I believe the
worst possible scenario as a result is that the button may be set to
inactive inappropriately, but I haven't seen any problems.
4. Brian implied it's there for a reason, so I've just copied that
code for the places plugin.
5. Based on Jasper's response, I've opened this bug to alter GTK's
documentation: http://bugzilla.gnome.org/show_bug.cgi?id=431856 .
Again, thanks Brian and Jasper. I hope to release places v0.2 this weekend.
-Diego Ongaro
On 4/20/07, Jasper Huijsmans <jasper at xfce.org> wrote:
> Hi Diego,
>
> Diego Ongaro wrote:
> > I sent this message to the goodies-dev list, but Brian Tarricone
> > suggested I send it to xfce4-dev. I've also added a couple comments he
> > made on IRC.
> >
> ...
> > 2) registering menu with panel
> >
> > xfdesktop calls xfce_panel_plugin_register_menu() before each time the
> > menu is opened. Is it sufficient to call
> > xfce_panel_plugin_register_menu() only when the menu is (re-)created?
> >
> >
> No you have to call it every time the menu is opened. That function
> probably should have been called *_register_open_menu() or something. It
> allows the panel to properly handle focus, transparency, autohide and
> probably some other things when the menu closes.
>
> > 3) Menu deactivate signal
> >
> > menu_activate() stores the signal id of the menu_deactivated()
> > callback with the menu. Later, menu_deactivated() does two things.
> > First, it sets the button state to inactivated. Second, it retrieves
> > the signal id and disables that signal with it. Is this done simply
> > because the deactivate callback could be connected multiple times?
> >
> > Brian on IRC: "i don't know, but it's probably more complicated than
> > it needs to be"
> >
> >
> The panel does something like this, but that's because the register
> function is called every time the menu is opened -- hmm, that does make
> me wonder if that was really necessary, a one-time registration might
> have worked just as well...., ah well, soimthing for the next redesign
> ;-) Anyway, you can probably get away with connecting the signal only once.
>
> ...
> > 5) Tooltips
> >
> > This is probably the wrong mailing list for this item. Regardless:
> >
> > I call gtk_tooltips_new() and then gtk_tooltips_set_tip() on the
> > button to _("Places"). Do I need to ref, unref, and/or sink the
> > GtkTooltips variable? xfdesktop keeps a pointer to its GtkTooltips
> > struct since its tooltip changes based on preferences. It later calls
> > gtk_object_sink() in dmp_free().
> >
> > Brian on IRC: "i never remember whether or not you have to unref/sink
> > GtkTooltips. it's possible that when you calk gtk_tooltips_set_tip(),
> > the sinks and takes owners hip of it but i don't know. reading gtk
> > source will probably tell you, though"
> >
> >
> Ok, this is from memory, so I may not remember this correctly, but I
> think it's like this:
>
> gtk_tooltips_new() creates a GtkObject with a floating reference. This
> means that you either use it like that and call gtk_object_sink() to
> free the object, or you take a reference (g_object_ref()), remove the
> floating flag (gtk_object_sink()) and then to free the object you use
> g_object_unref().
>
> HTH,
>
> Jasper
>
> _______________________________________________
> Xfce4-dev mailing list
> Xfce4-dev at xfce.org
> http://foo-projects.org/mailman/listinfo/xfce4-dev
>
More information about the Xfce4-dev
mailing list