[gnome-settings-daemon/wip/laney/systemd-user] common: Have plugins signal to systemd when they are ready



commit 66f3e162ee07eef2cd653d93d394688a2b8d5e35
Author: Iain Lane <iain orangesquash org uk>
Date:   Fri Dec 15 15:03:55 2017 +0000

    common: Have plugins signal to systemd when they are ready
    
    The plugins are about to switch to being activated by systemd. Some of
    them claim names on the bus, but not all. Be consistent and just notify
    systemd explicitly from the templace when the plugin is ready.

 configure.ac                            |    1 +
 plugins/clipboard/Makefile.am           |    5 ++++-
 plugins/color/Makefile.am               |    1 +
 plugins/common/daemon-skeleton-gtk.h    |    4 ++++
 plugins/common/daemon-skeleton.h        |    4 ++++
 plugins/dummy/Makefile.am               |    5 ++++-
 plugins/print-notifications/Makefile.am |    1 +
 plugins/sharing/Makefile.am             |    1 +
 plugins/xsettings/Makefile.am           |    1 +
 9 files changed, 21 insertions(+), 2 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index bee9abe..454ddba 100644
--- a/configure.ac
+++ b/configure.ac
@@ -290,6 +290,7 @@ PKG_CHECK_MODULES(COMMON,
                  x11
                  kbproto
                  xi
+                 libsystemd
                  $GUDEV_PKG
                  $LIBWACOM_PKG)
 PKG_CHECK_MODULES(HELPER, gio-unix-2.0)
diff --git a/plugins/clipboard/Makefile.am b/plugins/clipboard/Makefile.am
index 3189ac6..d27e712 100644
--- a/plugins/clipboard/Makefile.am
+++ b/plugins/clipboard/Makefile.am
@@ -24,7 +24,10 @@ gsd_clipboard_CPPFLAGS =                                     \
        -I$(top_srcdir)/plugins/common                          \
        -DGNOME_SETTINGS_LOCALEDIR=\""$(datadir)/locale"\"
 
-gsd_clipboard_LDADD = $(CLIPBOARD_LIBS) $(top_builddir)/gnome-settings-daemon/libgsd.la
+gsd_clipboard_LDADD =                                          \
+       $(top_builddir)/plugins/common/libcommon.la             \
+       $(top_builddir)/gnome-settings-daemon/libgsd.la         \
+       $(CLIPBOARD_LIBS)
 
 desktopdir = $(sysconfdir)/xdg/autostart
 desktop_in_files = org.gnome.SettingsDaemon.Clipboard.desktop.in
diff --git a/plugins/color/Makefile.am b/plugins/color/Makefile.am
index 35dcad4..ef56daf 100644
--- a/plugins/color/Makefile.am
+++ b/plugins/color/Makefile.am
@@ -73,6 +73,7 @@ gsd_color_CPPFLAGS =                                          \
        $(AM_CPPFLAGS)
 
 gsd_color_LDADD =                                              \
+       $(top_builddir)/plugins/common/libcommon.la             \
        $(top_builddir)/gnome-settings-daemon/libgsd.la         \
        $(COLOR_LIBS)                                           \
        $(LIBM)
diff --git a/plugins/common/daemon-skeleton-gtk.h b/plugins/common/daemon-skeleton-gtk.h
index 27aade6..fad0325 100644
--- a/plugins/common/daemon-skeleton-gtk.h
+++ b/plugins/common/daemon-skeleton-gtk.h
@@ -18,6 +18,8 @@
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
 
+#include <systemd/sd-daemon.h>
+
 #include "gnome-settings-bus.h"
 
 #ifndef PLUGIN_NAME
@@ -83,6 +85,7 @@ respond_to_end_session (GDBusProxy *proxy)
 static void
 do_stop (void)
 {
+        sd_notify (FALSE, "STOPPING=1");
         gtk_main_quit ();
 }
 
@@ -223,6 +226,7 @@ main (int argc, char **argv)
 
         manager = NEW ();
        register_with_gnome_session ();
+       sd_notify (FALSE, "READY=1");
 
        if (should_run ()) {
                error = NULL;
diff --git a/plugins/common/daemon-skeleton.h b/plugins/common/daemon-skeleton.h
index e4641fc..cae96f8 100644
--- a/plugins/common/daemon-skeleton.h
+++ b/plugins/common/daemon-skeleton.h
@@ -17,6 +17,8 @@
 
 #include <glib/gi18n.h>
 
+#include <systemd/sd-daemon.h>
+
 #include "gnome-settings-bus.h"
 
 #ifndef PLUGIN_NAME
@@ -81,6 +83,7 @@ respond_to_end_session (GDBusProxy *proxy)
 static void
 do_stop (GMainLoop *loop)
 {
+        sd_notify (FALSE, "STOPPING=1");
         g_main_loop_quit (loop);
 }
 
@@ -196,6 +199,7 @@ main (int argc, char **argv)
 
         manager = NEW ();
        register_with_gnome_session (loop);
+       sd_notify (FALSE, "READY=1");
 
        if (should_run ()) {
                error = NULL;
diff --git a/plugins/dummy/Makefile.am b/plugins/dummy/Makefile.am
index cb5856c..229515b 100644
--- a/plugins/dummy/Makefile.am
+++ b/plugins/dummy/Makefile.am
@@ -17,7 +17,10 @@ gsd_dummy_CPPFLAGS =                 \
        -DGNOME_SETTINGS_LOCALEDIR=\""$(datadir)/locale"\" \
        $(AM_CPPFLAGS)
 
-gsd_dummy_LDADD = $(DUMMY_LIBS) $(top_builddir)/gnome-settings-daemon/libgsd.la
+gsd_dummy_LDADD =                                      \
+       $(top_builddir)/gnome-settings-daemon/libgsd.la \
+       $(top_builddir)/plugins/common/libcommon.la     \
+       $(DUMMY_LIBS)
 
 desktopdir = $(sysconfdir)/xdg/autostart
 
diff --git a/plugins/print-notifications/Makefile.am b/plugins/print-notifications/Makefile.am
index 0e6b6d7..e845f1f 100644
--- a/plugins/print-notifications/Makefile.am
+++ b/plugins/print-notifications/Makefile.am
@@ -43,6 +43,7 @@ gsd_print_notifications_CFLAGS =                      \
 
 gsd_print_notifications_LDADD =                                \
        $(top_builddir)/gnome-settings-daemon/libgsd.la         \
+       $(top_builddir)/plugins/common/libcommon.la     \
        $(CUPS_LIBS)                                            \
        $(PRINT_NOTIFICATIONS_LIBS)
 
diff --git a/plugins/sharing/Makefile.am b/plugins/sharing/Makefile.am
index df99688..3fae49e 100644
--- a/plugins/sharing/Makefile.am
+++ b/plugins/sharing/Makefile.am
@@ -18,6 +18,7 @@ gsd_sharing_CPPFLAGS =                                                \
        $(AM_CPPFLAGS)
 gsd_sharing_LDADD =                                    \
        $(top_builddir)/gnome-settings-daemon/libgsd.la \
+       $(top_builddir)/plugins/common/libcommon.la     \
        $(SHARING_LIBS)
 
 desktopdir = $(sysconfdir)/xdg/autostart
diff --git a/plugins/xsettings/Makefile.am b/plugins/xsettings/Makefile.am
index bc62c8a..0e9d4bf 100644
--- a/plugins/xsettings/Makefile.am
+++ b/plugins/xsettings/Makefile.am
@@ -82,6 +82,7 @@ gsd_xsettings_CPPFLAGS =                                                                    
          \
        -DGTK_MODULES_DIRECTORY=\""$(libdir)/gnome-settings-daemon-@GSD_API_VERSION@/gtk-modules/"\"
 
 gsd_xsettings_LDADD =                                          \
+       $(top_builddir)/plugins/common/libcommon.la             \
        $(top_builddir)/gnome-settings-daemon/libgsd.la         \
        $(XSETTINGS_LIBS)
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]