aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-08-08 11:05:08 -0600
committerTed Gould <ted@canonical.com>2009-08-08 11:05:08 -0600
commite522c2c39f2543f1992f6f45879b8ff901b2c3b3 (patch)
tree8943708a1084ea797b70ce259274de0d0dd38e2b
parente445c0f0ec5bfcf7571f951dfb6889fd2f3558c2 (diff)
downloadayatana-indicator-session-e522c2c39f2543f1992f6f45879b8ff901b2c3b3.tar.gz
ayatana-indicator-session-e522c2c39f2543f1992f6f45879b8ff901b2c3b3.tar.bz2
ayatana-indicator-session-e522c2c39f2543f1992f6f45879b8ff901b2c3b3.zip
Setting the icon from the callback of asking the value
-rw-r--r--src/indicator-sus.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/indicator-sus.c b/src/indicator-sus.c
index e7b067f..f33eff0 100644
--- a/src/indicator-sus.c
+++ b/src/indicator-sus.c
@@ -39,6 +39,7 @@ static DbusmenuGtkClient * users_client = NULL;
static DbusmenuGtkClient * session_client = NULL;
static GtkMenu * main_menu = NULL;
+static GtkImage * status_image = NULL;
static GtkWidget * status_separator = NULL;
static GtkWidget * users_separator = NULL;
@@ -72,9 +73,9 @@ get_label (void)
GtkImage *
get_icon (void)
{
- GtkImage * image = GTK_IMAGE(gtk_image_new_from_icon_name("user-offline", GTK_ICON_SIZE_MENU));
- gtk_widget_show(GTK_WIDGET(image));
- return image;
+ status_image = GTK_IMAGE(gtk_image_new_from_icon_name("user-offline", GTK_ICON_SIZE_MENU));
+ gtk_widget_show(GTK_WIDGET(status_image));
+ return status_image;
}
static void
@@ -190,6 +191,11 @@ status_icon_changed (void)
void
status_icon_cb (DBusGProxy * proxy, char * icons, GError *error, gpointer userdata)
{
+ g_return_if_fail(status_image != NULL);
+ g_return_if_fail(icons != NULL);
+ g_return_if_fail(icons[0] == '\0');
+
+ gtk_image_set_from_icon_name(status_image, icons, GTK_ICON_SIZE_MENU);
return;
}