changeset 11989:c7a36461b00c

[gaim-migrate @ 14282] Stop the docklet blinking going crazy committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Sun, 06 Nov 2005 19:25:18 +0000
parents 9ccbd9f8e8c6
children f08a5365e2c9
files plugins/docklet/docklet.c
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/docklet/docklet.c	Sun Nov 06 19:16:32 2005 +0000
+++ b/plugins/docklet/docklet.c	Sun Nov 06 19:25:18 2005 +0000
@@ -54,6 +54,7 @@
 static DockletStatus status = DOCKLET_STATUS_OFFLINE;
 static gulong gtkblist_delete_cb_id = 0;
 static gboolean enable_join_chat = FALSE;
+static guint docklet_blinking_timer = 0;
 
 /**************************************************************************
  * docklet status and utility functions
@@ -79,6 +80,7 @@
 			ret = TRUE; /* keep blinking */
 			break;
 		default:
+			docklet_blinking_timer = 0;
 			blinked = FALSE;
 			break;
 	}
@@ -158,9 +160,10 @@
 			ui_ops->update_icon(status);
 
 		/* and schedule the blinker function if messages are pending */
-		if (status == DOCKLET_STATUS_ONLINE_PENDING 
-				|| status == DOCKLET_STATUS_AWAY_PENDING) {
-			g_timeout_add(500, docklet_blink_icon, &handle);
+		if ((status == DOCKLET_STATUS_ONLINE_PENDING
+				|| status == DOCKLET_STATUS_AWAY_PENDING)
+			&& docklet_blinking_timer == 0) {
+				docklet_blinking_timer = g_timeout_add(500, docklet_blink_icon, &handle);
 		}
 	}