Make it easier for apps to withdraw notifications appropriately
Currently, the notifications list in GNOME shell often gets cluttered up with old notifications that are no longer relevant. An example:
In an ideal world, all these apps would manually track their notifications and withdraw them at the correct time, so they don't clutter up the list. However, my previous attempt to encourage this behaviour had limited limited success, and I'm not optimistic about the prospects of an initiative to get all of GNOME's core apps to do it, let alone 3rd party apps.
An alternative might be add additional methods to GNotification, to allow notifications to be withdrawn without apps needing to do a lot of work.
The most promising behaviour here is probably "withdraw when focused". This would instruct the shell to remove a notification from the list when the window of the issuing app is focused. This behaviour could be applied to:
- "build successful" notifications from Builder
- file operation notifications from Files
- all messaging notifications - from Polari, Fractal, etc
- "command completed" notifications from the various terminals
Other notification withdrawal behaviours that we could also consider include:
- Withdraw at a specified date/time - this could be useful for imposing arbitrary time limits on notifications which might be ignored. For example, "app updated" notifications from Software could be withdrawn after a day.
- Withdraw when app exits - this would make sense for all the examples listed above, with the exception of messaging notifications.