# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1592905057 0 # Node ID 37060de79102cd66082ed12d8f81647ee6d851eb # Parent cdc5124b6525bb0a108fbe493a1587f42f196d4f GTK: Versions of Glib prior to May 2019 don't support GFileIcon for notifications. Also fix a GVariant warning in g_simple_action_new(). diff -r cdc5124b6525 -r 37060de79102 gtk/dw.c --- 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)); diff -r cdc5124b6525 -r 37060de79102 gtk3/dw.c --- a/gtk3/dw.c Tue Jun 23 08:39:44 2020 +0000 +++ b/gtk3/dw.c Tue Jun 23 09:37:37 2020 +0000 @@ -2069,7 +2069,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)); @@ -11094,10 +11094,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));