[dconf] set serial number sooner



commit a5c13067f8a764e46df8c711961e7762e2d3bdbc
Author: Ryan Lortie <desrt desrt ca>
Date:   Mon Jun 7 12:21:09 2010 +0200

    set serial number sooner
    
    Waiting until we acquired the name to set the serial number caused the
    first event when activating to have a serial number of zero.  This
    caused the client to ignore it.

 service/service.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/service/service.c b/service/service.c
index aa01705..3f3634d 100644
--- a/service/service.c
+++ b/service/service.c
@@ -280,6 +280,9 @@ bus_acquired (GDBusConnection *connection,
   static const GDBusInterfaceVTable interface_vtable = { method_call };
   DConfWriter *writer = user_data;
 
+  writer->serial = time (NULL);
+  writer->serial <<= 32;
+
   g_dbus_connection_register_object (connection, "/",
                                      &writer_interface, &interface_vtable,
                                      writer, NULL, NULL);
@@ -290,10 +293,6 @@ name_acquired (GDBusConnection *connection,
                const gchar     *name,
                gpointer         user_data)
 {
-  DConfWriter *writer = user_data;
-
-  writer->serial = time (NULL);
-  writer->serial <<= 32;
 }
 
 static void
@@ -322,7 +321,7 @@ main (void)
   writer.loop = g_main_loop_new (NULL, FALSE);
   writer.path = g_build_filename (g_get_user_config_dir (), "dconf", NULL);
 
-  g_bus_own_name (G_BUS_TYPE_SESSION, "ca.desrt.dconf", 0,
+  g_bus_own_name (G_BUS_TYPE_STARTER, "ca.desrt.dconf", 0,
                   bus_acquired, name_acquired, name_lost, &writer, NULL);
 
   g_main_loop_run (writer.loop);



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