Mercurial > dwindows
diff gtk/dw.c @ 2115:79e5842fb609
GTK: Fixes for building with GTK after the notification image changes.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Tue, 23 Jun 2020 08:13:24 +0000 |
parents | 251d050d306b |
children | 37060de79102 |
line wrap: on
line diff
--- a/gtk/dw.c Tue Jun 23 07:48:29 2020 +0000 +++ b/gtk/dw.c Tue Jun 23 08:13:24 2020 +0000 @@ -12367,7 +12367,7 @@ * This will create a system notification that will show in the notifaction panel * on supported systems, which may be clicked to perform another task. */ -HWND dw_notification_new(const char *title, HPIXMAP pixmap, const char *description, ...) +HWND dw_notification_new(const char *title, const char *imagepath, const char *description, ...) { #if GLIB_CHECK_VERSION(2,40,0) GNotification *notification = g_notification_new(title); @@ -12385,13 +12385,14 @@ g_notification_set_body(notification, outbuf); } - if(imagepath) + /* check if we can read from this file (it exists and read permission) */ + if(imagepath && access(imagepath, 04 ) != 0) { GFile *file = g_file_new_for_path(imagepath); if(file) { - GFileIcon *icon = g_file_icon_new(file); + GIcon *icon = g_file_icon_new(file); if(icon) g_notification_set_icon(notification, G_ICON(icon));