From b3108e1ad23387327d6cc7ebfdb20307878dd5c3 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Tue, 23 Jul 2024 11:53:30 +0200 Subject: notify: separate active notifications from unfinished kitty notifications This fixes an issue where it wasn't possible to trigger multiple notifications with the same kitty notification ID. This is something that works in kitty, and there's no reason why it shouldn't work. The issue was that we track stdout, and the notification helper's PID in the notification struct. Thus, when a notification is being displayed, we can't re-use the same notification struct instance for another notification. This patch fixes this by adding a new notification list, 'active_notifications'. Whenever we detect that we need to track the helper (notification want's to either focus the window on activation, or send an event to the application), we add a copy of the notification to the 'active' list. The notification can then be removed from the 'kitty' list, allowing kitty notifications to re-use the same ID over and over again, even if old notifications are still being displayed. --- notify.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'notify.h') diff --git a/notify.h b/notify.h index 55ace52d..90fbf9fc 100644 --- a/notify.h +++ b/notify.h @@ -60,7 +60,7 @@ struct notification_icon { char *tmp_file_on_disk; }; -bool notify_notify(const struct terminal *term, struct notification *notif); +bool notify_notify(struct terminal *term, struct notification *notif); void notify_free(struct terminal *term, struct notification *notif); void notify_icon_add(struct terminal *term, const char *id, -- cgit v1.3