From 409e654b54e19d0e50d200a706487d141c5cf89f Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 27 Aug 2009 10:48:06 -0500 Subject: Bumping Dbusmenu version to 0.0.2 --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index ac90330..c1fc1ec 100644 --- a/configure.ac +++ b/configure.ac @@ -25,7 +25,7 @@ m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) GTK_REQUIRED_VERSION=2.12 INDICATOR_REQUIRED_VERSION=0.2.0 -DBUSMENUGTK_REQUIRED_VERSION=0.0.0 +DBUSMENUGTK_REQUIRED_VERSION=0.0.2 PKG_CHECK_MODULES(APPLET, gtk+-2.0 >= $GTK_REQUIRED_VERSION indicator >= $INDICATOR_REQUIRED_VERSION -- cgit v1.2.3 From 1765940759064c0d7cd8428a3c89fa862f24f076 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 27 Aug 2009 12:52:30 -0500 Subject: Instead of populating the menu on added, populate it on realization. --- src/indicator-session.c | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/src/indicator-session.c b/src/indicator-session.c index 07efc86..43c568f 100644 --- a/src/indicator-session.c +++ b/src/indicator-session.c @@ -61,6 +61,7 @@ static void child_added (DbusmenuMenuitem * parent, DbusmenuMenuitem * child, gu static guint status_menu_pos_offset (void); static guint users_menu_pos_offset (void); static guint session_menu_pos_offset (void); +static void child_realized (DbusmenuMenuitem * child, gpointer userdata); GtkLabel * get_label (void) @@ -79,14 +80,44 @@ get_icon (void) return status_image; } +typedef struct _realized_data_t realized_data_t; +struct _realized_data_t { + guint position; + section_t section; +}; + static void child_added (DbusmenuMenuitem * parent, DbusmenuMenuitem * child, guint position, gpointer section) { + realized_data_t * data = g_new0(realized_data_t, 1); + if (data == NULL) { + g_warning("Unable to allocate data for realization of item"); + return; + } + + data->position = position; + data->section = GPOINTER_TO_UINT(section); + + g_signal_connect(G_OBJECT(child), DBUSMENU_MENUITEM_SIGNAL_REALIZED, G_CALLBACK(child_realized), data); + return; +} + +static void +child_realized (DbusmenuMenuitem * child, gpointer userdata) +{ + g_return_if_fail(userdata != NULL); + g_return_if_fail(DBUSMENU_IS_MENUITEM(child)); + + realized_data_t * data = (realized_data_t *)userdata; + guint position = data->position; + section_t section = data->section; + g_free(data); + DbusmenuGtkClient * client = NULL; gchar * errorstr = NULL; guint (*posfunc) (void) = NULL; - switch (GPOINTER_TO_UINT(section)) { + switch (section) { case STATUS_SECTION: client = status_client; errorstr = "Status"; -- cgit v1.2.3 From cc8a87dfca40afd26ab6989db11dd63ea2eccf5c Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 27 Aug 2009 13:33:41 -0500 Subject: Updating to dbusmenu version 0.1.0 --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index c1fc1ec..28b2c8b 100644 --- a/configure.ac +++ b/configure.ac @@ -25,7 +25,7 @@ m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) GTK_REQUIRED_VERSION=2.12 INDICATOR_REQUIRED_VERSION=0.2.0 -DBUSMENUGTK_REQUIRED_VERSION=0.0.2 +DBUSMENUGTK_REQUIRED_VERSION=0.1.0 PKG_CHECK_MODULES(APPLET, gtk+-2.0 >= $GTK_REQUIRED_VERSION indicator >= $INDICATOR_REQUIRED_VERSION -- cgit v1.2.3