comparison gtk3/dw.c @ 2209:0b6e1b5c8b5e

GTK: Fix building with glib versions 2.40 to 2.51. Notifications are supported starting with 2.40, but the image requires 2.52. This disables the image unless building with 2.52 or higher.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sat, 05 Dec 2020 00:34:25 +0000
parents 3343ae3ac327
children 7677e1083d07
comparison
equal deleted inserted replaced
2208:3343ae3ac327 2209:0b6e1b5c8b5e
11123 vsnprintf(outbuf, 1024, description, args); 11123 vsnprintf(outbuf, 1024, description, args);
11124 va_end(args); 11124 va_end(args);
11125 11125
11126 g_notification_set_body(notification, outbuf); 11126 g_notification_set_body(notification, outbuf);
11127 } 11127 }
11128 #if GLIB_CHECK_VERSION(2,52,0)
11128 if(imagepath) 11129 if(imagepath)
11129 { 11130 {
11130 GFile *file = g_file_new_for_path(imagepath); 11131 GFile *file = g_file_new_for_path(imagepath);
11131 GBytes *bytes = g_file_load_bytes(file, NULL, NULL, NULL); 11132 GBytes *bytes = g_file_load_bytes(file, NULL, NULL, NULL);
11132 11133
11136 11137
11137 if(icon) 11138 if(icon)
11138 g_notification_set_icon(notification, G_ICON(icon)); 11139 g_notification_set_icon(notification, G_ICON(icon));
11139 } 11140 }
11140 } 11141 }
11142 #endif
11141 g_notification_set_default_action_and_target(notification, "app.notification", "t", 11143 g_notification_set_default_action_and_target(notification, "app.notification", "t",
11142 (guint64)DW_POINTER_TO_ULONGLONG(notification)); 11144 (guint64)DW_POINTER_TO_ULONGLONG(notification));
11143 } 11145 }
11144 return (HWND)notification; 11146 return (HWND)notification;
11145 #else 11147 #else