diff --git a/cmd/hyprpanel-client/hud.go b/cmd/hyprpanel-client/hud.go index f9bea86..3d1579a 100644 --- a/cmd/hyprpanel-client/hud.go +++ b/cmd/hyprpanel-client/hud.go @@ -229,7 +229,10 @@ func (h *hud) update(data *eventv1.HudNotificationValue) error { h.showNotification() go func() { - <-h.timer.C + select { + case <-h.timer.C: + case <-h.itemClosed: + } h.closeItem() }() diff --git a/cmd/hyprpanel-client/notification_item.go b/cmd/hyprpanel-client/notification_item.go index 438a39a..cc08a7e 100644 --- a/cmd/hyprpanel-client/notification_item.go +++ b/cmd/hyprpanel-client/notification_item.go @@ -312,7 +312,11 @@ func (i *notificationItem) build(container *gtk.Box) error { }) go func() { - <-i.timer.C + select { + case <-i.timer.C: + case <-i.closed: + } + i.close() }()