Run the notifications display deamon with a systemd service.
authorManuel Bachmann <manuel.bachmann@open.eurogiciel.org>
Tue, 3 Jun 2014 09:28:00 +0000 (11:28 +0200)
committerManuel Bachmann <manuel.bachmann@open.eurogiciel.org>
Tue, 3 Jun 2014 09:28:00 +0000 (11:28 +0200)
Change-Id: I62e6594d5fb3a004f61df3113e4690e0156a910c
Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
Makefile.am
configure.ac
notification_display_service.c
notifications_display.service.in [new file with mode: 0644]
packaging/notification-service.spec

index 3941621..2442cba 100644 (file)
@@ -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
index 72aa0d8..258e7c9 100644 (file)
@@ -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
index 3e25ea5..8a7d992 100644 (file)
@@ -31,7 +31,7 @@ void display_notifications ()
        notification_get_list (NOTIFICATION_TYPE_NOTI, -1, &notification_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 (file)
index 0000000..ca6d196
--- /dev/null
@@ -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
index 50cca55..7426af7 100644 (file)
@@ -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,-)