[Goodies-dev] Questions about xfdesktop's menu plugin

Diego Ongaro ongardie at gmail.com
Thu Apr 19 05:18:07 CEST 2007


In preparation for the next release of the places plugin, I based much
of the view on xfdesktop's menu panel plugin. Jens (perldude)
suggested I drop the arrow, so the plugin now behaves like the menu
rather than a launcher. Below, I've listed 5 different questions I
have about xfdesktop's code.

1) g_object_ref new image

Line 1016-7 of xfdesktop:
    dmp->image = gtk_image_new();
    g_object_ref(G_OBJECT(dmp->image));

As far as I know, this is never unref'ed. Is that intentional?

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?

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?

4) Control-click

dmp_poopup has:
  if(evt->button != 1 || ((evt->state & GDK_CONTROL_MASK)
  && !(evt->state & (GDK_MOD1_MASK|GDK_SHIFT_MASK
  |GDK_MOD4_MASK))))

I see what that does, but why? Is this for the poor folks with 1-button mice?

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().


Please respond to this email or catch me on IRC if you can help with
any of these.
Thanks,
Diego Ongaro (ongardie on freenode)



More information about the Goodies-dev mailing list