aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-gtk/client.c
diff options
context:
space:
mode:
Diffstat (limited to 'libdbusmenu-gtk/client.c')
-rw-r--r--libdbusmenu-gtk/client.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/libdbusmenu-gtk/client.c b/libdbusmenu-gtk/client.c
index b2d19b4..0f24c39 100644
--- a/libdbusmenu-gtk/client.c
+++ b/libdbusmenu-gtk/client.c
@@ -134,17 +134,15 @@ destoryed_dbusmenuitem_cb (gpointer udata, GObject * dbusmenuitem)
static void
new_menuitem (DbusmenuClient * client, DbusmenuMenuitem * mi, gpointer userdata)
{
- gpointer ann_mi = g_object_get_data(G_OBJECT(mi), data_menuitem);
- GtkMenuItem * gmi = GTK_MENU_ITEM(ann_mi);
-
- if (gmi != NULL) {
- /* It's possible we've already been looked at, that's
- okay, but we can just ignore this signal then. */
- return;
- }
+ g_warning("Got new menuitem signal, which means they want something");
+ g_warning(" that I simply don't have.");
- gmi = GTK_MENU_ITEM(gtk_menu_item_new());
+ return;
+}
+static void
+base_new_menuitem (DbusmenuMenuitem * mi, GtkMenuItem * gmi, DbusmenuGtkClient * client)
+{
/* Attach these two */
g_object_set_data(G_OBJECT(mi), data_menuitem, gmi);
@@ -270,7 +268,19 @@ dbusmenu_gtkclient_menuitem_get (DbusmenuGtkClient * client, DbusmenuMenuitem *
static gboolean
new_item_normal (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent)
{
+ gpointer ann_mi = g_object_get_data(G_OBJECT(newitem), data_menuitem);
+ GtkMenuItem * gmi = GTK_MENU_ITEM(ann_mi);
+
+ if (gmi != NULL) {
+ /* It's possible we've already been looked at, that's
+ okay, but we can just ignore this signal then. */
+ return TRUE;
+ }
+
+ gmi = GTK_MENU_ITEM(gtk_menu_item_new());
+ // Need client
+ base_new_menuitem(newitem, gmi, NULL);
return TRUE;
}