changeset 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
files gtk/dw.c gtk3/dw.c
diffstat 2 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/gtk/dw.c	Fri Dec 04 23:56:11 2020 +0000
+++ b/gtk/dw.c	Sat Dec 05 00:34:25 2020 +0000
@@ -12460,6 +12460,7 @@
 
          g_notification_set_body(notification, outbuf);
       }
+#if GLIB_CHECK_VERSION(2,52,0)
       if(imagepath)
       {
          GFile *file = g_file_new_for_path(imagepath);
@@ -12473,6 +12474,7 @@
                g_notification_set_icon(notification, G_ICON(icon));
          }
       }
+#endif
       g_notification_set_default_action_and_target(notification, "app.notification", "t", 
                                                   (guint64)DW_POINTER_TO_ULONGLONG(notification)); 
    }
--- a/gtk3/dw.c	Fri Dec 04 23:56:11 2020 +0000
+++ b/gtk3/dw.c	Sat Dec 05 00:34:25 2020 +0000
@@ -11125,6 +11125,7 @@
 
          g_notification_set_body(notification, outbuf);
       }
+#if GLIB_CHECK_VERSION(2,52,0)
       if(imagepath)
       {
          GFile *file = g_file_new_for_path(imagepath);
@@ -11138,6 +11139,7 @@
                g_notification_set_icon(notification, G_ICON(icon));
          }
       }
+#endif
       g_notification_set_default_action_and_target(notification, "app.notification", "t", 
                                                   (guint64)DW_POINTER_TO_ULONGLONG(notification)); 
    }