Index: plugins/mail-notification/ChangeLog
===================================================================
--- plugins/mail-notification/ChangeLog	(revision 35865)
+++ plugins/mail-notification/ChangeLog	(working copy)
@@ -1,3 +1,10 @@
+2008-07-30  Milan Crha  <mcrha@redhat.com>
+
+	** Part of fix for bug #353927
+
+	* mail-notification.c: (icon_activated), (stop_blinking_cb),
+	(new_notify_status): Do not blink the icon more than 15 seconds.
+
 2008-07-22  Milan Crha  <mcrha@redhat.com>
 
 	** Part of fix for bug #544022
Index: plugins/mail-notification/mail-notification.c
===================================================================
--- plugins/mail-notification/mail-notification.c	(revision 35865)
+++ plugins/mail-notification/mail-notification.c	(working copy)
@@ -271,6 +271,7 @@ get_config_widget_dbus (void)
 #define GCONF_KEY_STATUS_NOTIFICATION	GCONF_KEY_ROOT "status-notification"
 
 static GtkStatusIcon *status_icon = NULL;
+static guint blink_timeout_id = 0;
 static unsigned int status_count = 0;
 
 #ifdef HAVE_LIBNOTIFY
@@ -295,6 +296,11 @@ icon_activated (GtkStatusIcon *icon, gpo
 	gtk_status_icon_set_visible (status_icon, FALSE);
 	g_object_unref (status_icon);
 
+	if (blink_timeout_id) {
+		g_source_remove (blink_timeout_id);
+		blink_timeout_id = 0;
+	}
+
 	status_icon = NULL;
 	status_count = 0;
 }
@@ -307,6 +313,17 @@ notification_callback (gpointer notify)
 }
 #endif
 
+static gboolean
+stop_blinking_cb (gpointer data)
+{
+	blink_timeout_id = 0;
+
+	if (status_icon)
+		gtk_status_icon_set_blinking (status_icon, FALSE);
+
+	return FALSE;
+}
+
 struct _StatusConfigureWidgets
 {
 	GtkWidget *enable;
@@ -428,8 +445,9 @@ static void
 new_notify_status (EMEventTargetFolder *t)
 {
 	char *msg;
+	gboolean new_icon = !status_icon;
 
-	if (!status_icon) {
+	if (new_icon) {
 		status_icon = gtk_status_icon_new ();
 		gtk_status_icon_set_from_pixbuf (status_icon, e_icon_factory_get_icon ("mail-unread", E_ICON_SIZE_LARGE_TOOLBAR));
 	}
@@ -447,8 +465,13 @@ new_notify_status (EMEventTargetFolder *
 	}
 
 	gtk_status_icon_set_tooltip (status_icon, msg);
+
+	if (new_icon && is_part_enabled (GCONF_KEY_STATUS_BLINK)) {
+		gtk_status_icon_set_blinking (status_icon, TRUE);
+		blink_timeout_id = g_timeout_add_seconds (15, stop_blinking_cb, NULL);
+	}
+
 	gtk_status_icon_set_visible (status_icon, TRUE);
-	gtk_status_icon_set_blinking (status_icon, is_part_enabled (GCONF_KEY_STATUS_BLINK));
 
 	#ifdef HAVE_LIBNOTIFY
 	/* Now check whether we're supposed to send notifications */
Index: calendar/gui/alarm-notify/alarm-queue.c
===================================================================
--- calendar/gui/alarm-notify/alarm-queue.c	(revision 35865)
+++ calendar/gui/alarm-notify/alarm-queue.c	(working copy)
@@ -79,7 +79,7 @@ static GList *tray_icons_list = NULL;
 /* Top Tray Image */
 static GtkStatusIcon *tray_icon = NULL;
 static int tray_blink_id = -1;
-static int tray_blink_state = FALSE;
+static int tray_blink_countdown = 0;
 static AlarmNotify *an;
 
 /* Structure that stores a client we are monitoring */
@@ -1383,11 +1383,13 @@ popup_menu (GtkStatusIcon *icon, guint b
 static gboolean
 tray_icon_blink_cb (gpointer data)
 {
+	static gboolean tray_blink_state = FALSE;
 	GdkPixbuf *pixbuf;
 
-	tray_blink_state = tray_blink_state == TRUE ? FALSE: TRUE;
+	tray_blink_countdown--;
+	tray_blink_state = !tray_blink_state;
 
-	pixbuf = e_icon_factory_get_icon  (tray_blink_state == TRUE?
+	pixbuf = e_icon_factory_get_icon  ((tray_blink_state || tray_blink_countdown <= 0)?
 					   "stock_appointment-reminder-excl" :
 					   "stock_appointment-reminder",
 					   E_ICON_SIZE_LARGE_TOOLBAR);
@@ -1396,7 +1398,10 @@ tray_icon_blink_cb (gpointer data)
 		gtk_status_icon_set_from_pixbuf (tray_icon, pixbuf);
 	g_object_unref (pixbuf);
 
-	return TRUE;
+	if (tray_blink_countdown <= 0)
+		tray_blink_id = -1;
+
+	return tray_blink_countdown > 0;
 }
 
 
@@ -1536,8 +1541,10 @@ display_notification (time_t trigger, Co
 		open_alarm_dialog (tray_data);
 		gtk_window_stick (GTK_WINDOW (alarm_notifications_dialog->dialog));
 	} else {
-		if (tray_blink_id == -1)
+		if (tray_blink_id == -1) {
+			tray_blink_countdown = 30;
 			tray_blink_id = g_timeout_add (500, tray_icon_blink_cb, tray_data);
+		}
 	}
 }
 
Index: calendar/ChangeLog
===================================================================
--- calendar/ChangeLog	(revision 35865)
+++ calendar/ChangeLog	(working copy)
@@ -1,3 +1,10 @@
+2008-07-30  Milan Crha  <mcrha@redhat.com>
+
+	** Part of fix for bug #353927
+
+	* gui/alarm-notify/alarm-queue.c: (tray_icon_blink_cb),
+	(display_notification): Do not blink the icon more than 15 seconds.
+
 2008-07-30  Milan Crha  <mcrha@redhat.com>
 
 	** Fix for bug #211267
