Mercurial > dwindows
comparison gtk/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 | a43a3f80ed32 |
children | 7677e1083d07 |
comparison
equal
deleted
inserted
replaced
2208:3343ae3ac327 | 2209:0b6e1b5c8b5e |
---|---|
12458 vsnprintf(outbuf, 1024, description, args); | 12458 vsnprintf(outbuf, 1024, description, args); |
12459 va_end(args); | 12459 va_end(args); |
12460 | 12460 |
12461 g_notification_set_body(notification, outbuf); | 12461 g_notification_set_body(notification, outbuf); |
12462 } | 12462 } |
12463 #if GLIB_CHECK_VERSION(2,52,0) | |
12463 if(imagepath) | 12464 if(imagepath) |
12464 { | 12465 { |
12465 GFile *file = g_file_new_for_path(imagepath); | 12466 GFile *file = g_file_new_for_path(imagepath); |
12466 GBytes *bytes = g_file_load_bytes(file, NULL, NULL, NULL); | 12467 GBytes *bytes = g_file_load_bytes(file, NULL, NULL, NULL); |
12467 | 12468 |
12471 | 12472 |
12472 if(icon) | 12473 if(icon) |
12473 g_notification_set_icon(notification, G_ICON(icon)); | 12474 g_notification_set_icon(notification, G_ICON(icon)); |
12474 } | 12475 } |
12475 } | 12476 } |
12477 #endif | |
12476 g_notification_set_default_action_and_target(notification, "app.notification", "t", | 12478 g_notification_set_default_action_and_target(notification, "app.notification", "t", |
12477 (guint64)DW_POINTER_TO_ULONGLONG(notification)); | 12479 (guint64)DW_POINTER_TO_ULONGLONG(notification)); |
12478 } | 12480 } |
12479 return (HWND)notification; | 12481 return (HWND)notification; |
12480 #else | 12482 #else |