From e449f4098ba077b789a09bd4b5caa9baafd3953d Mon Sep 17 00:00:00 2001 From: Lars Uebernickel Date: Fri, 4 Oct 2013 15:18:59 +0200 Subject: app_source_action_check_draw: don't let invisible sources draw attention --- src/im-application-list.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/im-application-list.c b/src/im-application-list.c index dc21aeb..b63e4be 100644 --- a/src/im-application-list.c +++ b/src/im-application-list.c @@ -224,22 +224,25 @@ im_application_list_update_draws_attention (ImApplicationList *list) static gboolean app_source_action_check_draw (Application * app, const gchar * action_name) { - gboolean retval = FALSE; - GVariant * state; - GVariant * draw; + GVariant *state; + guint32 count; + gint64 time; + const gchar *string; + gboolean draws_attention; state = g_action_group_get_action_state (G_ACTION_GROUP(app->source_actions), action_name); if (state == NULL) return FALSE; - /* uxsb */ - draw = g_variant_get_child_value(state, 3); - retval = g_variant_get_boolean(draw); + g_variant_get (state, "(ux&sb)", &count, &time, &string, &draws_attention); + + /* invisible sources do not draw attention */ + if (count == 0 && time == 0 && (string == NULL || string[0] != '\0')) + draws_attention = FALSE; - g_variant_unref(draw); g_variant_unref(state); - return retval; + return draws_attention; } /* Check a message action to see if it draws */ -- cgit v1.2.3