mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
osc: kitty notification: implement 'close' events
Application can now request to receive a 'close' event when the notification is closed (but not necessarily activated), by adding 'c=1' to the notification request.
This commit is contained in:
parent
d53f0aea75
commit
c797222930
3 changed files with 30 additions and 6 deletions
11
notify.c
11
notify.c
|
|
@ -181,7 +181,7 @@ notif_done(struct reaper *reaper, pid_t pid, int status, void *data)
|
|||
if (notif->activated && notif->report_activated) {
|
||||
xassert(notif->id != NULL);
|
||||
|
||||
LOG_DBG("sending notification report to client");
|
||||
LOG_DBG("sending notification activation event to client");
|
||||
|
||||
char reply[7 + strlen(notif->id) + 1 + 2 + 1];
|
||||
int n = xsnprintf(
|
||||
|
|
@ -189,6 +189,15 @@ notif_done(struct reaper *reaper, pid_t pid, int status, void *data)
|
|||
term_to_slave(term, reply, n);
|
||||
}
|
||||
|
||||
if (notif->report_closed) {
|
||||
LOG_DBG("sending notification close event to client");
|
||||
|
||||
char reply[7 + strlen(notif->id) + 1 + 7 + 1 + 2 + 1];
|
||||
int n = xsnprintf(
|
||||
reply, sizeof(reply), "\033]99;i=%s:p=close;\033\\", notif->id);
|
||||
term_to_slave(term, reply, n);
|
||||
}
|
||||
|
||||
notify_free(term, notif);
|
||||
tll_remove(term->active_notifications, it);
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue