From 9e87f9d21735264129cbde58fd346617880480ba Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Tue, 18 Nov 2014 18:13:16 +0100 Subject: [PATCH] Avoid crash when using linphone/gtk with libnotify < 0.7.0 --- configure.ac | 1 - gtk/main.c | 11 ++++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index e7caf35b9..067a13b62 100644 --- a/configure.ac +++ b/configure.ac @@ -330,7 +330,6 @@ if test "$gtk_ui" = "true" ; then AC_DEFINE([HAVE_NOTIFY1],[1],[NOTIFY1 support]) esac else - NotifyNotification *n; echo "Libnotify support is disabled." fi fi diff --git a/gtk/main.c b/gtk/main.c index 5dd2b046f..ea3078c9a 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -1228,14 +1228,19 @@ static bool_t notify_actions_supported() { } static NotifyNotification* build_notification(const char *title, const char *body) { - const char *icon_path = linphone_gtk_get_ui_config("icon", LINPHONE_ICON); - GdkPixbuf *pbuf = create_pixbuf(icon_path); NotifyNotification *n = notify_notification_new(title, body, NULL #ifdef HAVE_NOTIFY1 ,NULL #endif ); - notify_notification_set_icon_from_pixbuf(n, pbuf); +#ifndef HAVE_NOTIFY1 + { + const char *icon_path = linphone_gtk_get_ui_config("icon", LINPHONE_ICON); + GdkPixbuf *pbuf = create_pixbuf(icon_path); + /*with notify1, this function makes the notification crash the app with obscure dbus glib critical errors*/ + notify_notification_set_icon_from_pixbuf(n, pbuf); + } +#endif return n; }