[connections/gnome-42] notifications: Improve notification lifetime management



commit c607af79e8ad78c17a74f73329dce6e002036acf
Author: Felipe Borges <felipeborges gnome org>
Date:   Fri Apr 1 15:25:47 2022 +0200

    notifications: Improve notification lifetime management

 src/notifications.vala | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/src/notifications.vala b/src/notifications.vala
index c630e0d..b553509 100644
--- a/src/notifications.vala
+++ b/src/notifications.vala
@@ -31,14 +31,12 @@ namespace Connections {
             }
 
             set {
-                var child = get_child ();
-                if (child != null)
-                    remove (child);
-
-                if (value != null)
-                    add (value);
+                if (_active_notification != null) {
+                    remove (_active_notification);
+                }
 
                 _active_notification = value;
+                add (_active_notification);
             }
         }
 


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