aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2012-04-23 13:31:39 -0500
committerCharles Kerr <charles.kerr@canonical.com>2012-04-23 13:31:39 -0500
commit0bf6adacf509aff960b1f450e4c7f01c3f4ca090 (patch)
treeee5c3c8d2735f1a5254c365454c1972b9961000f /src
parent859a831ee1ca77b17331caa3e3a154f56beb4199 (diff)
parentb894548cd9498d8a96743ca292287c3746d3545e (diff)
downloadlibayatana-appindicator-0bf6adacf509aff960b1f450e4c7f01c3f4ca090.tar.gz
libayatana-appindicator-0bf6adacf509aff960b1f450e4c7f01c3f4ca090.tar.bz2
libayatana-appindicator-0bf6adacf509aff960b1f450e4c7f01c3f4ca090.zip
merge lp:~ted/libappindicator/app_name to try the application name as a fallback if the client doesn't explicitly set the title.
Diffstat (limited to 'src')
-rw-r--r--src/app-indicator.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/app-indicator.c b/src/app-indicator.c
index 0d6450c..2e98b48 100644
--- a/src/app-indicator.c
+++ b/src/app-indicator.c
@@ -1123,7 +1123,18 @@ bus_get_prop (GDBusConnection * connection, const gchar * sender, const gchar *
} else if (g_strcmp0(property, "AttentionIconName") == 0) {
return g_variant_new_string(priv->attention_icon_name ? priv->attention_icon_name : "");
} else if (g_strcmp0(property, "Title") == 0) {
- return g_variant_new_string(priv->title ? priv->title : "");
+ const gchar * output = NULL;
+ if (priv->title == NULL) {
+ const gchar * name = g_get_application_name();
+ if (name != NULL) {
+ output = name;
+ } else {
+ output = "";
+ }
+ } else {
+ output = priv->title;
+ }
+ return g_variant_new_string(output);
} else if (g_strcmp0(property, "IconThemePath") == 0) {
return g_variant_new_string(priv->icon_theme_path ? priv->icon_theme_path : "");
} else if (g_strcmp0(property, "Menu") == 0) {