notify: don't create icon file on disk when we're not going to use it

We always prefer the symbolic name. Thus, there's no need to write raw
PNG data to disk if we have a symbolic name.

Furthermore, keep the file open until the cache entry is evicted.
This commit is contained in:
Daniel Eklöf 2024-07-24 15:59:52 +02:00
parent 24168ed86e
commit 37ab3b1603
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 27 additions and 13 deletions

View file

@ -58,7 +58,8 @@ struct notification {
struct notification_icon {
char *id;
char *symbolic_name;
char *tmp_file_on_disk;
char *tmp_file_name;
int tmp_file_fd;
};
bool notify_notify(struct terminal *term, struct notification *notif);