[gnome-todo] notification-widget: execute remaining notifications when quitting
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-todo] notification-widget: execute remaining notifications when quitting
- Date: Thu, 1 Dec 2016 02:52:42 +0000 (UTC)
commit f32167df475997fbd7dc1bad6a4e5fb45c36c6ea
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Thu Dec 1 00:51:32 2016 -0200
notification-widget: execute remaining notifications when quitting
When there are notifications available, we should execute them when
quitting the application.
https://bugzilla.gnome.org/show_bug.cgi?id=773834
src/notification/gtd-notification-widget.c | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/src/notification/gtd-notification-widget.c b/src/notification/gtd-notification-widget.c
index 33b7bc7..cb54155 100644
--- a/src/notification/gtd-notification-widget.c
+++ b/src/notification/gtd-notification-widget.c
@@ -191,7 +191,22 @@ gtd_notification_widget_finalize (GObject *object)
{
GtdNotificationWidget *self = (GtdNotificationWidget *)object;
GtdNotificationWidgetPrivate *priv = gtd_notification_widget_get_instance_private (self);
+ GList *l;
+ /* When quitting, always execute the primary option of the notifications */
+ if (priv->current_notification)
+ {
+ g_signal_handlers_disconnect_by_func (priv->current_notification,
+ gtd_notification_widget__notification_executed_cb,
+ self);
+
+ gtd_notification_execute_primary_action (priv->current_notification);
+ }
+
+ for (l = priv->queue->head; l != NULL; l = l->next)
+ gtd_notification_execute_primary_action (l->data);
+
+ /* And only after executing all of them, release the queue */
g_queue_free_full (priv->queue, g_object_unref);
G_OBJECT_CLASS (gtd_notification_widget_parent_class)->finalize (object);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]