aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2008-08-01 15:17:26 +0800
committerMilan Crha <mcrha@src.gnome.org>2008-08-01 15:17:26 +0800
commita7fa2367752b6d3b0c74d3391b5cf861027f122c (patch)
tree405e3c7ed99ef274e6cc6a894bf6584a4362fdd9
parentce5a6a7bd93a7a2087b87a6d885f827389bb0ad4 (diff)
downloadgsoc2013-evolution-a7fa2367752b6d3b0c74d3391b5cf861027f122c.tar
gsoc2013-evolution-a7fa2367752b6d3b0c74d3391b5cf861027f122c.tar.gz
gsoc2013-evolution-a7fa2367752b6d3b0c74d3391b5cf861027f122c.tar.bz2
gsoc2013-evolution-a7fa2367752b6d3b0c74d3391b5cf861027f122c.tar.lz
gsoc2013-evolution-a7fa2367752b6d3b0c74d3391b5cf861027f122c.tar.xz
gsoc2013-evolution-a7fa2367752b6d3b0c74d3391b5cf861027f122c.tar.zst
gsoc2013-evolution-a7fa2367752b6d3b0c74d3391b5cf861027f122c.zip
** Fix for bug #353927
2008-08-01 Milan Crha <mcrha@redhat.com> ** Fix for bug #353927 * calendar/gui/alarm-notify/alarm-queue.c: (tray_icon_blink_cb), (display_notification): Do not blink the icon more than 15 seconds. * plugins/mail-notification/mail-notification.c: (icon_activated), (stop_blinking_cb), (new_notify_status): Do not blink the icon more than 15 seconds. svn path=/trunk/; revision=35875
-rw-r--r--calendar/ChangeLog7
-rw-r--r--calendar/gui/alarm-notify/alarm-queue.c17
-rw-r--r--plugins/mail-notification/ChangeLog7
-rw-r--r--plugins/mail-notification/mail-notification.c27
4 files changed, 51 insertions, 7 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 60b5e5f62e..d80c2ff297 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,10 @@
+2008-08-01 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
diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c
index 9bc19d4aad..219dfdc82d 100644
--- a/calendar/gui/alarm-notify/alarm-queue.c
+++ b/calendar/gui/alarm-notify/alarm-queue.c
@@ -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 button, guint activate_time)
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, CompQueuedAlarms *cqa,
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);
+ }
}
}
diff --git a/plugins/mail-notification/ChangeLog b/plugins/mail-notification/ChangeLog
index 0d1c8e60ca..d0f0766b07 100644
--- a/plugins/mail-notification/ChangeLog
+++ b/plugins/mail-notification/ChangeLog
@@ -1,3 +1,10 @@
+2008-08-01 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
diff --git a/plugins/mail-notification/mail-notification.c b/plugins/mail-notification/mail-notification.c
index f9bfd4b8dd..afa633c999 100644
--- a/plugins/mail-notification/mail-notification.c
+++ b/plugins/mail-notification/mail-notification.c
@@ -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, gpointer pnotify)
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 *t)
}
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 */