summaryrefslogtreecommitdiff
path: root/atk-adaptor
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@gnome.org>2022-09-29 14:40:49 -0500
committerFederico Mena Quintero <federico@gnome.org>2023-05-09 10:04:25 -0600
commit06027ba5226ae4f57f9786a65ec6c98469828b46 (patch)
tree48558abbe0de4a4ccc6907c445dd40f93aef72f2 /atk-adaptor
parente2bb6b5593418f334ddf5d1e3404c434bedb403f (diff)
downloadat-spi2-core-06027ba5226ae4f57f9786a65ec6c98469828b46.tar.gz
Wait for the test-application startup using an atspi listener
This should be more robust than just waiting and sleeping. * test-application now claims a different DBus name for each run, to disambiguate. * atk_bridge_adaptor_cleanup() - release the dbus name if there was one
Diffstat (limited to 'atk-adaptor')
-rw-r--r--atk-adaptor/bridge.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/atk-adaptor/bridge.c b/atk-adaptor/bridge.c
index a2b1de83..462ec0a3 100644
--- a/atk-adaptor/bridge.c
+++ b/atk-adaptor/bridge.c
@@ -686,7 +686,7 @@ new_connection_cb (DBusServer *server, DBusConnection *con, void *data)
spi_global_app_data->direct_connections = g_list_append (spi_global_app_data->direct_connections, con);
}
-gchar *atspi_dbus_name = NULL;
+static gchar *atspi_dbus_name = NULL;
static gboolean atspi_no_register = FALSE;
static GOptionEntry atspi_option_entries[] = {
@@ -1222,6 +1222,26 @@ atk_bridge_adaptor_cleanup (void)
{
dbus_connection_remove_filter (spi_global_app_data->bus, signal_filter, NULL);
droute_context_unregister (spi_global_app_data->droute, spi_global_app_data->bus);
+
+ if (atspi_dbus_name != NULL)
+ {
+ DBusError error;
+ int result;
+
+ dbus_error_init (&error);
+ result = dbus_bus_release_name (spi_global_app_data->bus, atspi_dbus_name, &error);
+ if (result == -1)
+ {
+ g_warning ("atk-bridge: could not release dbus name: %s", error.message);
+ }
+ else
+ {
+ g_print ("bridge: released name, result %d\n", result);
+ }
+
+ dbus_error_free (&error);
+ }
+
dbus_connection_close (spi_global_app_data->bus);
dbus_connection_unref (spi_global_app_data->bus);
spi_global_app_data->bus = NULL;