[gnome-boxes/gnome-3-24] notificationbar: Call each notification dismiss() at cleanup



commit a37293c9c5d05de2df237219da2027b17799d549
Author: Felipe Borges <felipeborges gnome org>
Date:   Mon Jan 8 17:05:05 2018 +0100

    notificationbar: Call each notification dismiss() at cleanup
    
    Each Notification object wraps in a GLib.Timeout in order to
    schedule the execution of the callback.
    
    Boxes gets stuck if it is closed when a notification hasn't
    finished yet.
    
    The solution for that is to make sure that each Notification's
    dimiss() method gets called when the GtkApplication shutdown
    method is invoked. This way we can ensure that all the sources
    are removed from the default main context.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=784923

 src/notificationbar.vala | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/src/notificationbar.vala b/src/notificationbar.vala
index 3a285f8a..1a2ee102 100644
--- a/src/notificationbar.vala
+++ b/src/notificationbar.vala
@@ -76,10 +76,8 @@
     }
 
     public void dismiss_all () {
-        // We destroy all active notifications, which will cause them to be dismissed
-        while (active_notifications != null) {
-            active_notifications.data.destroy ();
-        }
+        foreach (var notification in active_notifications)
+            (notification as Notification).dismiss ();
     }
 
     private void add_notification (Widget w) {


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