Mercurial > dwindows
diff gtk/dw.c @ 2117:37060de79102
GTK: Versions of Glib prior to May 2019 don't support GFileIcon for
notifications. Also fix a GVariant warning in g_simple_action_new().
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Tue, 23 Jun 2020 09:37:37 +0000 |
parents | 79e5842fb609 |
children | c3f088266bcd |
line wrap: on
line diff
--- a/gtk/dw.c Tue Jun 23 08:39:44 2020 +0000 +++ b/gtk/dw.c Tue Jun 23 09:37:37 2020 +0000 @@ -2141,7 +2141,7 @@ { #if GLIB_CHECK_VERSION(2,40,0) /* Creat our notification handler for any notifications */ - GSimpleAction *action = g_simple_action_new("notification", "t"); + GSimpleAction *action = g_simple_action_new("notification", G_VARIANT_TYPE_UINT64); g_signal_connect(G_OBJECT(action), "activate", G_CALLBACK(_dw_notification_handler), NULL); g_action_map_add_action(G_ACTION_MAP(_DWApp), G_ACTION(action)); @@ -12389,10 +12389,11 @@ if(imagepath && access(imagepath, 04 ) != 0) { GFile *file = g_file_new_for_path(imagepath); + GBytes *bytes = g_file_load_bytes(file, NULL, NULL, NULL); - if(file) - { - GIcon *icon = g_file_icon_new(file); + if(bytes) + { + GIcon *icon = g_bytes_icon_new(bytes); if(icon) g_notification_set_icon(notification, G_ICON(icon));