From 63331bc7d84c4d4cf11b0746293c7264b057de0d Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 2 Mar 2012 15:57:24 -0600 Subject: Sets the title of the status icon to the title of the appindicator and the name to the ID --- src/app-indicator.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app-indicator.c b/src/app-indicator.c index 6c693e8..1e24bd1 100644 --- a/src/app-indicator.c +++ b/src/app-indicator.c @@ -1510,7 +1510,8 @@ fallback (AppIndicator * self) { GtkStatusIcon * icon = gtk_status_icon_new(); - gtk_status_icon_set_title(icon, app_indicator_get_id(self)); + gtk_status_icon_set_name(icon, app_indicator_get_id(self)); + gtk_status_icon_set_title(icon, app_indicator_get_title(self)); g_signal_connect(G_OBJECT(self), APP_INDICATOR_SIGNAL_NEW_STATUS, G_CALLBACK(status_icon_status_wrapper), icon); -- cgit v1.2.3 -- cgit v1.2.3 From 002c16bd0b040dfb39468898eb904f035ea2b97c Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 2 Mar 2012 16:00:36 -0600 Subject: Handle the title changing at runtime --- src/app-indicator.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/app-indicator.c b/src/app-indicator.c index 1e24bd1..92aae3b 100644 --- a/src/app-indicator.c +++ b/src/app-indicator.c @@ -897,6 +897,10 @@ app_indicator_set_property (GObject * object, guint prop_id, const GValue * valu if (oldtitle != NULL) { g_free(oldtitle); } + + if (priv->status_icon != NULL) { + gtk_status_icon_set_title(priv->status_icon, priv->title); + } break; } case PROP_LABEL_GUIDE: { -- cgit v1.2.3 From fafea8adaeafdfb79e5a5df29433a9af0b199adc Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 2 Mar 2012 16:03:37 -0600 Subject: Protecting from NULL titles, which apparently status_icon can't take :-/ --- src/app-indicator.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/app-indicator.c b/src/app-indicator.c index 92aae3b..f3d0b65 100644 --- a/src/app-indicator.c +++ b/src/app-indicator.c @@ -899,7 +899,7 @@ app_indicator_set_property (GObject * object, guint prop_id, const GValue * valu } if (priv->status_icon != NULL) { - gtk_status_icon_set_title(priv->status_icon, priv->title); + gtk_status_icon_set_title(priv->status_icon, priv->title ? priv->title : ""); } break; } @@ -1515,7 +1515,10 @@ fallback (AppIndicator * self) GtkStatusIcon * icon = gtk_status_icon_new(); gtk_status_icon_set_name(icon, app_indicator_get_id(self)); - gtk_status_icon_set_title(icon, app_indicator_get_title(self)); + const gchar * title = app_indicator_get_title(self); + if (title != NULL) { + gtk_status_icon_set_title(icon, title); + } g_signal_connect(G_OBJECT(self), APP_INDICATOR_SIGNAL_NEW_STATUS, G_CALLBACK(status_icon_status_wrapper), icon); -- cgit v1.2.3