notify: don't focus/report on notification dismissal

Only do it when the notification was activated.

Here, activated means the 'click to activate' notification action was
triggered.

How do we tie everything together?

First, we add a new template parameter, ${action}. It's intended to be
used with e.g. notify-send's --action option.

When the action is triggered, notify-send prints its name on stdout,
on a separate line. Look for this in stdout. Only if we've seen it do
we focus/report the notification.
This commit is contained in:
Daniel Eklöf 2024-07-23 16:41:52 +02:00
parent 55a4e59ef9
commit 045ead985c
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
6 changed files with 46 additions and 19 deletions

View file

@ -45,6 +45,7 @@ struct notification {
* Used internally by notify
*/
bool activated; /* User 'activated' the notification */
char *xdg_token; /* XDG activation token, from daemon */
pid_t pid; /* Notifier command PID */