return bus;
}
+static void
+set_reply (DBusPendingCall *pending, void *user_data)
+{
+ void **replyptr = (void **)user_data;
+
+ *replyptr = dbus_pending_call_steal_reply (pending);
+}
+
+static DBusMessage *
+send_and_allow_reentry (DBusConnection *bus, DBusMessage *message, DBusError *error)
+{
+ DBusPendingCall *pending;
+ DBusMessage *reply = NULL;
+
+ if (!dbus_connection_send_with_reply (bus, message, &pending, -1))
+ {
+ return NULL;
+ }
+ dbus_pending_call_set_notify (pending, set_reply, (void *)&reply, NULL);
+ while (!reply)
+ {
+ if (!dbus_connection_read_write_dispatch (bus, -1)) return NULL;
+ }
+ return reply;
+}
/*---------------------------------------------------------------------------*/
static gboolean
dbus_message_iter_init_append (message, &iter);
spi_object_append_reference (&iter, app->root);
-
- reply = dbus_connection_send_with_reply_and_block (app->bus, message, -1, &error);
+
+ reply = send_and_allow_reentry (app->bus, message, &error);
if (message)
dbus_message_unref (message);
{
DBusMessage *message;
*(plug_path++) = '\0';
- message = dbus_message_new_method_call (plug_name, plug_path, "org.a11y.atspi.Accessible", "Embedded");
+ message = dbus_message_new_method_call (plug_name, plug_path, SPI_DBUS_INTERFACE_SOCKET, "Embedded");
dbus_message_append_args (message, DBUS_TYPE_STRING, &path, DBUS_TYPE_INVALID);
dbus_connection_send (spi_global_app_data->bus, message, NULL);
}
dbus_connection_setup_with_g_main (spi_global_app_data->bus,
g_main_context_default ());
+ /* Hook our plug-and socket functions */
+ install_plug_hooks ();
+
/*
* Create the leasing, register and cache objects.
* The order is important here, the cache depends on the
spi_initialize_hypertext (accpath);
spi_initialize_image (accpath);
spi_initialize_selection (accpath);
+ spi_initialize_socket (accpath);
spi_initialize_table (accpath);
spi_initialize_text (accpath);
spi_initialize_value (accpath);
/* Register methods to send D-Bus signals on certain ATK events */
spi_atk_register_event_listeners ();
- /* Hook our plug-and socket functions */
- install_plug_hooks ();
-
/* Register this app by sending a signal out to AT-SPI registry daemon */
- if (!atspi_no_register)
+ if (!atspi_no_register && (!root || !ATK_IS_PLUG (root)))
register_application (spi_global_app_data);
g_atexit (exit_func);