summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Lehner <cel@celehner.com>2016-01-19 17:00:35 -0500
committerCharles Lehner <cel@celehner.com>2016-01-19 17:13:38 -0500
commitcc0b10400e75a91023f192a6008c36c8cb176ab9 (patch)
treebcd91aced09b326d38458a73ca97b488c673ddee
parent6a8e3d34355826b66457c86424e8c7f3e8a8260a (diff)
gtk: remove duplicate notification declaration. Fix #107
Allow using USE_LIBNOTIFY even when GLib >= 2.40 is available
-rw-r--r--modules/gtk/gtk_mod.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/modules/gtk/gtk_mod.c b/modules/gtk/gtk_mod.c
index 83000d6..f1d8711 100644
--- a/modules/gtk/gtk_mod.c
+++ b/modules/gtk/gtk_mod.c
@@ -310,9 +310,15 @@ static void notify_incoming_call(struct gtk_mod *mod,
GtkWidget *menu_item;
#if defined(USE_LIBNOTIFY)
NotifyNotification *notification;
-#endif
-#if GLIB_CHECK_VERSION(2,40,0)
+ if (!notify_is_initted())
+ return;
+ notification = notify_notification_new(title, msg, "baresip");
+ notify_notification_set_urgency(notification, NOTIFY_URGENCY_CRITICAL);
+ notify_notification_show(notification, NULL);
+ g_object_unref(notification);
+
+#elif GLIB_CHECK_VERSION(2,40,0)
char id[64];
GVariant *target;
GNotification *notification = g_notification_new(title);
@@ -336,14 +342,6 @@ static void notify_incoming_call(struct gtk_mod *mod,
g_application_send_notification(mod->app, id, notification);
g_object_unref(notification);
-#elif defined(USE_LIBNOTIFY)
- /* If glib does not have GNotification, use libnotify instead. */
- if (!notify_is_initted())
- return;
- notification = notify_notification_new(title, msg, "baresip");
- notify_notification_set_urgency(notification, NOTIFY_URGENCY_CRITICAL);
- notify_notification_show(notification, NULL);
- g_object_unref(notification);
#else
(void)msg;
(void)title;