Skip to content

Commit

Permalink
Support for libnotify >= 0.7.0
Browse files Browse the repository at this point in the history
The most recent developer version of libnotify changed the signature for
notify_notification_new(). Make the configure script detect the version
of libnotify and use the according function signature.
  • Loading branch information
inguin committed Nov 13, 2010
1 parent b248989 commit ba55c03
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions configure.ac
Expand Up @@ -42,6 +42,12 @@ Use --disable-notifications to disable desktop notifications.]) ]
)
AC_SUBST(LIBNOTIFY_CFLAGS)
AC_SUBST(LIBNOTIFY_LIBS)
PKG_CHECK_MODULES(LIBNOTIFY_OLD, libnotify < 0.7.0,
[ AC_MSG_NOTICE([Using old libnotify API.])
AC_DEFINE([HAVE_LIBNOTIFY_OLD], [1],
[Define to 1 if libnotify version is below 0.7.0]) ],
[ AC_MSG_NOTICE([Using new libnotify API.]) ]
)
fi

# Checks for header files.
Expand Down
4 changes: 4 additions & 0 deletions src/notify.c
Expand Up @@ -12,7 +12,11 @@ void nall_notify_init(void)

void nall_notify(run_data_t* s)
{
#ifdef HAVE_LIBNOTIFY_OLD
NotifyNotification* notification = notify_notification_new(s->name, s->buf, NULL, NULL);
#else
NotifyNotification* notification = notify_notification_new(s->name, s->buf, NULL);
#endif
if (s->status == 0)
notify_notification_set_urgency(notification, NOTIFY_URGENCY_NORMAL);
else
Expand Down

0 comments on commit ba55c03

Please sign in to comment.