aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-09-04 21:02:21 -0500
committerTed Gould <ted@canonical.com>2009-09-04 21:02:21 -0500
commit2a87b9c42f64cd97c60c2d21733bba9f4625e8cc (patch)
treea2de103e52eb7e939a59065410cef05b5811e5e3
parent467063d1291347dd04fd28acdb30facc4858df3f (diff)
downloadayatana-indicator-messages-2a87b9c42f64cd97c60c2d21733bba9f4625e8cc.tar.gz
ayatana-indicator-messages-2a87b9c42f64cd97c60c2d21733bba9f4625e8cc.tar.bz2
ayatana-indicator-messages-2a87b9c42f64cd97c60c2d21733bba9f4625e8cc.zip
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.
-rw-r--r--src/messages-service.c28
1 files changed, 25 insertions, 3 deletions
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;