diff --git a/meson.build b/meson.build index 7ff6e8e..8445151 100644 --- a/meson.build +++ b/meson.build @@ -47,11 +47,15 @@ config_h.set_quoted('PACKAGE_NAME', meson.project_name()) config_h.set_quoted('PACKAGE_VERSION', meson.project_version()) config_h.set_quoted('PACKAGE_STRING', '@0@ @1@'.format(meson.project_name(), meson.project_version())) -xdp_dep = dependency('xdg-desktop-portal') +xdp_dep = dependency('xdg-desktop-portal', version: '>=1.14.0') desktop_portal_interfaces_dir = xdp_dep.get_variable(pkgconfig: 'interfaces_dir') +if xdp_dep.version().version_compare('>= 1.19.1') + config_h.set('HAVE_XDP_1_19_1', 1) +endif + portal_deps = [ - dependency('xdg-desktop-portal', version: '>=1.14.0'), + xdp_dep, dependency('glib-2.0', version: '>=2.44'), dependency('gio-unix-2.0'), dependency('gtk+-3.0', version: '>=3.14'), diff --git a/src/notification.c b/src/notification.c index aaea5a8..b109456 100644 --- a/src/notification.c +++ b/src/notification.c @@ -124,7 +124,11 @@ handle_add_notification (XdpImplNotification *object, fdo_add_notification (connection, arg_app_id, arg_id, arg_notification, activate_action, NULL); +#ifdef HAVE_XDP_1_19_1 + xdp_impl_notification_complete_add_notification (object, invocation, NULL); +#else xdp_impl_notification_complete_add_notification (object, invocation); +#endif return TRUE; }