Remove notification timeout when removed

This commit is contained in:
Erik Reider
2021-12-21 20:11:40 +01:00
parent f7096fbdb8
commit 02e0cf6c52
2 changed files with 4 additions and 3 deletions

View File

@@ -121,8 +121,9 @@ namespace SwayNotificatonCenter {
} }
private void remove_notification (Notification noti) { private void remove_notification (Notification noti) {
// Remove notification // Remove notification and its destruction timeout
if (noti != null) { if (noti != null) {
noti.remove_noti_timeout ();
noti.destroy (); noti.destroy ();
} }

View File

@@ -299,7 +299,7 @@ namespace SwayNotificatonCenter {
} }
} }
private void add_noti_timeout () { public void add_noti_timeout () {
uint timeout; uint timeout;
switch (param.urgency) { switch (param.urgency) {
case UrgencyLevels.LOW : case UrgencyLevels.LOW :
@@ -321,7 +321,7 @@ namespace SwayNotificatonCenter {
} }
} }
private void remove_noti_timeout () { public void remove_noti_timeout () {
if (timeout_id > 0) { if (timeout_id > 0) {
Source.remove (timeout_id); Source.remove (timeout_id);
timeout_id = 0; timeout_id = 0;