[gnome-boxes] notificationbar: Call each notification dismiss() at cleanup
- From: Felipe Borges <felipeborges src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes] notificationbar: Call each notification dismiss() at cleanup
- Date: Tue, 9 Jan 2018 11:23:27 +0000 (UTC)
commit 81722d61d430276e3dcf5e35e7955aba0157eaaa
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 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/src/notificationbar.vala b/src/notificationbar.vala
index 3a285f8..1a2ee10 100644
--- a/src/notificationbar.vala
+++ b/src/notificationbar.vala
@@ -76,10 +76,8 @@ private class Boxes.Notificationbar: Gtk.Grid {
}
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]