GNOME Bugzilla – Bug 623142
Ensure ::new-connection runs before processing D-Bus messages
Last modified: 2010-06-30 15:58:18 UTC
Currently we actually start handling incoming D-Bus messages before code in ::new-connection runs which isn't exactly ideal. To fix this I think we're going to need gboolean g_dbus_connection_is_frozen (); void g_dbus_connection_freeze() void g_dbus_connection_thaw() and a :frozen object property (with GObject::notify support). We're also going to need this /* If set, the newly created GDBusConnection will be frozen */ G_DBUS_CONNECTION_FLAGS_FROZEN With this API, GDBusServer will simply pass G_DBUS_CONNECTION_FLAGS_FROZEN when creating the new connection (in on_run()), run the ::new-connection signal (in an idle) and then thaw the connection. Simple as pie!
would be better, I think, to have a GDBusConnectionFlag along the lines of _DELAY_MESSAGE_PROCESSING and a one-shot API call like g_dbus_connection_start_processing();
Fixed here using G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING and g_dbus_connection_start_message_processing(). I also included a test case for this. http://git.gnome.org/browse/glib/commit/?id=038d03cd08bdb42e6f83f6041ec01732476e900b