From 2a87b9c42f64cd97c60c2d21733bba9f4625e8cc Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 4 Sep 2009 21:02:21 -0500 Subject: Oops, a little silly before. We really need to check the indicators as well, we can't just clear the attention for the count value. --- src/messages-service.c | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/messages-service.c b/src/messages-service.c index 6dafa97..2467dd4 100644 --- a/src/messages-service.c +++ b/src/messages-service.c @@ -411,6 +411,23 @@ check_attention (void) return; } +/* This checks a server listing to see if it should + have attention. It can get attention through it's + count or by having an indicator that is requestion + attention. */ +static void +server_attention (serverList_t * slt) +{ + /* Count, easy yes and out. */ + if (slt->count > 0) { + slt->attention = TRUE; + return; + } + + + return; +} + static void server_added (IndicateListener * listener, IndicateListenerServer * server, gchar * type, gpointer data) { @@ -490,13 +507,18 @@ server_count_changed (AppMenuItem * appitem, guint count, gpointer data) slt->count = count; if (count == 0 && slt->attention) { - slt->attention = FALSE; - check_attention(); + /* Regen based on indicators if the count isn't going to cause it. */ + server_attention(slt); + /* If we're dropping let's see if we're the last. */ + if (!slt->attention) { + check_attention(); + } } if (count != 0 && !slt->attention) { slt->attention = TRUE; - check_attention(); + /* Let's tell everyone about us! */ + message_service_dbus_set_attention(dbus_interface, TRUE); } return; -- cgit v1.2.3