diff options
author | Lars Uebernickel <lars.uebernickel@canonical.com> | 2013-10-04 15:18:59 +0200 |
---|---|---|
committer | Lars Uebernickel <lars.uebernickel@canonical.com> | 2013-10-04 15:18:59 +0200 |
commit | e449f4098ba077b789a09bd4b5caa9baafd3953d (patch) | |
tree | 8e14ebe20b88e557dcc489ec68ab16d552b178e6 | |
parent | 5fd82c0139dd0ddddcb3c73b0d9401510229b20a (diff) | |
download | ayatana-indicator-messages-e449f4098ba077b789a09bd4b5caa9baafd3953d.tar.gz ayatana-indicator-messages-e449f4098ba077b789a09bd4b5caa9baafd3953d.tar.bz2 ayatana-indicator-messages-e449f4098ba077b789a09bd4b5caa9baafd3953d.zip |
app_source_action_check_draw: don't let invisible sources draw attention
-rw-r--r-- | src/im-application-list.c | 19 |
1 files changed, 11 insertions, 8 deletions
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 */ |