diff --git a/registryd/registry-main.c b/registryd/registry-main.c
index e8133fe..d4d24d5 100644
--- a/registryd/registry-main.c
+++ b/registryd/registry-main.c
@@ -57,6 +57,8 @@ static GDBusProxy      *client_proxy = NULL;
 
 #define SM_CLIENT_DBUS_INTERFACE "org.gnome.SessionManager.ClientPrivate"
 
+static gboolean register_client (void);
+
 static void
 on_session_over (GDBusProxy *proxy,
                  gchar      *sender_name,
@@ -66,6 +68,9 @@ on_session_over (GDBusProxy *proxy,
 {
         if (g_strcmp0 (signal_name, "SessionOver") == 0) {
                 g_main_loop_quit (mainloop);
+        } else if (g_strcmp0 (signal_name, "SessionRunning") == 0) {
+                if (!register_client ())
+                        g_warning ("Unable to register client with session manager");
         }
 }
 
@@ -87,7 +92,7 @@ session_manager_connect (void)
 static gboolean
 end_session_response (gboolean is_okay, const gchar *reason)
 {
-  GVariant *ret;
+        GVariant *ret;
         GError *error = NULL;
 
         if (!reason)
@@ -132,7 +137,7 @@ static gboolean
 register_client (void)
 {
         GError     *error;
-  GVariant *res;
+        GVariant *res;
         const char *startup_id;
         const char *app_id;
 
@@ -232,9 +237,6 @@ main (int argc, char **argv)
     {
       if (!session_manager_connect ())
           g_warning ("Unable to connect to session manager");
-
-      if (!register_client ())
-          g_warning ("Unable to register client with session manager");
     }
 
   g_main_loop_run (mainloop);
