diff options
author | Milan Crha <mcrha@redhat.com> | 2008-08-01 15:17:26 +0800 |
---|---|---|
committer | Milan Crha <mcrha@src.gnome.org> | 2008-08-01 15:17:26 +0800 |
commit | a7fa2367752b6d3b0c74d3391b5cf861027f122c (patch) | |
tree | 405e3c7ed99ef274e6cc6a894bf6584a4362fdd9 /plugins/mail-notification | |
parent | ce5a6a7bd93a7a2087b87a6d885f827389bb0ad4 (diff) | |
download | gsoc2013-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
Diffstat (limited to 'plugins/mail-notification')
-rw-r--r-- | plugins/mail-notification/ChangeLog | 7 | ||||
-rw-r--r-- | plugins/mail-notification/mail-notification.c | 27 |
2 files changed, 32 insertions, 2 deletions
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 */ |