aboutsummaryrefslogtreecommitdiff
path: root/src/im-application-list.c
diff options
context:
space:
mode:
authorLars Uebernickel <lars.uebernickel@canonical.com>2013-08-27 12:35:02 +0200
committerLars Uebernickel <lars.uebernickel@canonical.com>2013-08-27 12:35:02 +0200
commite1050a9ceed9cfd0c31ebcaf1d4abb931c5d62ed (patch)
treea78bf0a5acc3a40fce5e0acdc07b6a9d50ae7a91 /src/im-application-list.c
parent0eae4379c30b5afe8f21f88b30c7ce5d795556d0 (diff)
downloadayatana-indicator-messages-e1050a9ceed9cfd0c31ebcaf1d4abb931c5d62ed.tar.gz
ayatana-indicator-messages-e1050a9ceed9cfd0c31ebcaf1d4abb931c5d62ed.tar.bz2
ayatana-indicator-messages-e1050a9ceed9cfd0c31ebcaf1d4abb931c5d62ed.zip
desktop menu: don't show sources with a count of 0
Diffstat (limited to 'src/im-application-list.c')
-rw-r--r--src/im-application-list.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/im-application-list.c b/src/im-application-list.c
index ce88db0..17fffdc 100644
--- a/src/im-application-list.c
+++ b/src/im-application-list.c
@@ -476,11 +476,12 @@ im_application_list_class_init (ImApplicationListClass *klass)
NULL, NULL,
g_cclosure_marshal_generic,
G_TYPE_NONE,
- 4,
+ 5,
G_TYPE_STRING,
G_TYPE_STRING,
G_TYPE_STRING,
- G_TYPE_STRING);
+ G_TYPE_STRING,
+ G_TYPE_BOOLEAN);
signals[SOURCE_REMOVED] = g_signal_new ("source-removed",
IM_TYPE_APPLICATION_LIST,
@@ -806,6 +807,7 @@ im_application_list_source_changed (Application *app,
const gchar *string;
gboolean draws_attention;
gboolean old_draw;
+ gboolean visible;
g_variant_get (source, "(&s&s&sux&sb)",
&id, &label, &iconstr, &count, &time, &string, &draws_attention);
@@ -815,9 +817,11 @@ im_application_list_source_changed (Application *app,
g_action_group_change_action_state (G_ACTION_GROUP (app->source_actions), id,
g_variant_new ("(uxsb)", count, time, string, draws_attention));
- g_signal_emit (app->list, signals[SOURCE_CHANGED], 0, app->id, id, label, iconstr);
+ visible = count > 0;
+
+ g_signal_emit (app->list, signals[SOURCE_CHANGED], 0, app->id, id, label, iconstr, visible);
- if (!old_draw && draws_attention)
+ if (visible && !old_draw && draws_attention)
app->draws_attention = TRUE;
im_application_list_update_draws_attention (app->list);