From 1d0ff74679adfa23f46ba7d64375e36bcdf69ee4 Mon Sep 17 00:00:00 2001 From: Erik Reider Date: Thu, 6 Jan 2022 18:09:32 +0100 Subject: [PATCH] Fixed clear_all_notifications not sending a close action #52 --- src/controlCenter/controlCenter.vala | 3 ++- src/notification/notification.vala | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/controlCenter/controlCenter.vala b/src/controlCenter/controlCenter.vala index 1e3945a..4de1216 100644 --- a/src/controlCenter/controlCenter.vala +++ b/src/controlCenter/controlCenter.vala @@ -208,7 +208,8 @@ namespace SwayNotificatonCenter { public void close_all_notifications () { foreach (var w in list_box.get_children ()) { - if (w != null) list_box.remove (w); + Notification noti = (Notification) w; + if (noti != null) noti.close_notification (false); } try { diff --git a/src/notification/notification.vala b/src/notification/notification.vala index 4d69685..14b18f9 100644 --- a/src/notification/notification.vala +++ b/src/notification/notification.vala @@ -284,7 +284,7 @@ namespace SwayNotificatonCenter { return value; } - private void close_notification (bool is_timeout = false) { + public void close_notification (bool is_timeout = false) { remove_noti_timeout (); this.revealer.set_reveal_child (false); Timeout.add (this.transition_time, () => {