From ca8c94e3f0606130d2ae261b309aef05b9123e33 Mon Sep 17 00:00:00 2001 From: Manuel Bachmann Date: Tue, 3 Jun 2014 11:28:00 +0200 Subject: [PATCH] Run the notifications display deamon with a systemd service. Change-Id: I62e6594d5fb3a004f61df3113e4690e0156a910c Signed-off-by: Manuel Bachmann --- Makefile.am | 4 +++- configure.ac | 2 +- notification_display_service.c | 3 +-- notifications_display.service.in | 9 +++++++++ packaging/notification-service.spec | 3 +++ 5 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 notifications_display.service.in diff --git a/Makefile.am b/Makefile.am index 3941621..2442cba 100644 --- a/Makefile.am +++ b/Makefile.am @@ -31,8 +31,10 @@ bluetooth_notification_client_CFLAGS = -I. $(TIZEN_CFLAGS) bluetooth_notification_client_LDADD = $(TIZEN_LIBS) SCRIPT_IN_FILES = \ - notifications.service.in + notifications.service.in \ + notifications_display.service.in install-data-hook: $(mkinstalldirs) $(DESTDIR)/usr/lib/systemd/system/ install -m 0644 notifications.service $(DESTDIR)/usr/lib/systemd/system/notifications.service + install -m 0644 notifications_display.service $(DESTDIR)/usr/lib/systemd/system/notifications_display.service diff --git a/configure.ac b/configure.ac index 72aa0d8..258e7c9 100644 --- a/configure.ac +++ b/configure.ac @@ -19,6 +19,6 @@ PKG_CHECK_MODULES([TIZEN], [eina ecore com-core notification dbus-1 bluetooth-ap AC_SUBST(TIZEN_CFLAGS) AC_SUBST(TIZEN_LIBS) -AC_CONFIG_FILES([Makefile notifications.service]) +AC_CONFIG_FILES([Makefile notifications.service notifications_display.service]) AC_PROG_RANLIB([ranlib]) AC_OUTPUT diff --git a/notification_display_service.c b/notification_display_service.c index 3e25ea5..8a7d992 100644 --- a/notification_display_service.c +++ b/notification_display_service.c @@ -31,7 +31,7 @@ void display_notifications () notification_get_list (NOTIFICATION_TYPE_NOTI, -1, ¬ification_list); if (notification_list) { get_list = notification_list_get_head (notification_list); - while (get_list) { + if (get_list) { noti = notification_list_get_data (get_list); notification_get_pkgname (noti, &pkgname); if (pkgname == NULL) @@ -51,7 +51,6 @@ void display_notifications () # endif notification_delete (noti); - get_list = notification_list_get_head (notification_list); } } } diff --git a/notifications_display.service.in b/notifications_display.service.in new file mode 100644 index 0000000..ca6d196 --- /dev/null +++ b/notifications_display.service.in @@ -0,0 +1,9 @@ +[Unit] +Description=Notifications Popup daemon + +[Service] +Environment=XDG_RUNTIME_DIR=/run/display +ExecStart=/usr/bin/notification-display-service + +[Install] +WantedBy=graphical.target diff --git a/packaging/notification-service.spec b/packaging/notification-service.spec index 50cca55..7426af7 100644 --- a/packaging/notification-service.spec +++ b/packaging/notification-service.spec @@ -46,6 +46,7 @@ make %{?_smp_mflags} %install %make_install %install_service graphical.target.wants notifications.service +%install_service graphical.target.wants notifications_display.service %post %systemd_post notifications.service @@ -61,7 +62,9 @@ make %{?_smp_mflags} %{_bindir}/notification-service %{_bindir}/notification-display-service %{_unitdir}/notifications.service +%{_unitdir}/notifications_display.service %{_unitdir}/graphical.target.wants/notifications.service +%{_unitdir}/graphical.target.wants/notifications_display.service %files test %defattr(-,root,root,-) -- 2.7.4