[connections] notifications: Improve notification lifetime management



commit 52b97f5a2a44c42f35d0d5816c703bf9b60f4a1d
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]