aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-03-24 17:10:48 -0500
committerTed Gould <ted@gould.cx>2010-03-24 17:10:48 -0500
commitce879d3dedab7c15f7d72640f27458f46b7cf2c2 (patch)
tree4c6842fc9454fecc0d96a5d837be58a6648f7e15
parent9e0c000273432a04fe431e9e750a0c1a63e411fe (diff)
downloadayatana-indicator-messages-ce879d3dedab7c15f7d72640f27458f46b7cf2c2.tar.gz
ayatana-indicator-messages-ce879d3dedab7c15f7d72640f27458f46b7cf2c2.tar.bz2
ayatana-indicator-messages-ce879d3dedab7c15f7d72640f27458f46b7cf2c2.zip
Allow for applications icons to change incase we haven't gotten the property yet.
-rw-r--r--src/indicator-messages.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/indicator-messages.c b/src/indicator-messages.c
index 99e303b..988d9d6 100644
--- a/src/indicator-messages.c
+++ b/src/indicator-messages.c
@@ -207,6 +207,20 @@ setup_icon_proxy (gpointer userdata)
return FALSE;
}
+/* Sets the icon when it changes. */
+static void
+application_icon_change_cb (DbusmenuMenuitem * mi, gchar * prop, GValue * value, gpointer user_data)
+{
+ if (!g_strcmp0(prop, APPLICATION_MENUITEM_PROP_ICON)) {
+ /* Set the main icon */
+ if (GTK_IS_IMAGE(user_data)) {
+ gtk_image_set_from_icon_name(GTK_IMAGE(user_data), g_value_get_string(value), GTK_ICON_SIZE_MENU);
+ }
+ }
+
+ return;
+}
+
/* Sets the label when it changes. */
static void
application_prop_change_cb (DbusmenuMenuitem * mi, gchar * prop, GValue * value, gpointer user_data)
@@ -266,6 +280,7 @@ new_application_item (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, Dbu
/* Make sure we can handle the label changing */
g_signal_connect(G_OBJECT(newitem), DBUSMENU_MENUITEM_SIGNAL_PROPERTY_CHANGED, G_CALLBACK(application_prop_change_cb), label);
+ g_signal_connect(G_OBJECT(newitem), DBUSMENU_MENUITEM_SIGNAL_PROPERTY_CHANGED, G_CALLBACK(application_icon_change_cb), icon);
return TRUE;
}