[glib] gapplication: Initialize backend before withdrawing notifications



commit c612fcab0fb2d3f0bdaf011d5b566dc949dbd18a
Author: Kalev Lember <klember redhat com>
Date:   Mon Jun 22 19:56:38 2015 +0200

    gapplication: Initialize backend before withdrawing notifications
    
    Make sure to initialize the notification backend in
    g_application_withdraw_notification() the same way as is done in
    g_application_send_notification().
    
    This makes it possible for an app to withdraw notifications it has sent
    in a previous execution of the application.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=750625

 gio/gapplication.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gio/gapplication.c b/gio/gapplication.c
index be7127a..37a8258 100644
--- a/gio/gapplication.c
+++ b/gio/gapplication.c
@@ -2715,8 +2715,10 @@ g_application_withdraw_notification (GApplication *application,
   g_return_if_fail (G_IS_APPLICATION (application));
   g_return_if_fail (id != NULL);
 
-  if (application->priv->notifications)
-    g_notification_backend_withdraw_notification (application->priv->notifications, id);
+  if (application->priv->notifications == NULL)
+    application->priv->notifications = g_notification_backend_new_default (application);
+
+  g_notification_backend_withdraw_notification (application->priv->notifications, id);
 }
 
 /* Busy binding {{{1 */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]