summaryrefslogtreecommitdiff
path: root/bus
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2019-09-06 03:40:53 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2019-09-06 03:40:53 +0200
commit018443b7a8ad0b6f068c2255adcb49037a388d15 (patch)
tree62c4a19332f1e1cd7951f77eb8065e38317afdbf /bus
parent1e43ac742c7622beaa40902777a017efa3af2402 (diff)
downloadat-spi2-core-018443b7a8ad0b6f068c2255adcb49037a388d15.tar.gz
at-spi-bus-launcher: defer starting atspi bus after bus name acquired
In case bus name acquisition fails, we should not have started a bus after all, but worse, we should not have written its address in the AT_SPI_BUS X root property. We should thus do them only after having acquired the bus name.
Diffstat (limited to 'bus')
-rw-r--r--bus/at-spi-bus-launcher.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/bus/at-spi-bus-launcher.c b/bus/at-spi-bus-launcher.c
index af85f043..b4f49b85 100644
--- a/bus/at-spi-bus-launcher.c
+++ b/bus/at-spi-bus-launcher.c
@@ -683,16 +683,6 @@ on_bus_acquired (GDBusConnection *connection,
}
app->session_bus = connection;
- if (app->launch_immediately)
- {
- ensure_a11y_bus (app);
- if (app->state == A11Y_BUS_STATE_ERROR)
- {
- g_main_loop_quit (app->loop);
- return;
- }
- }
-
error = NULL;
registration_id = g_dbus_connection_register_object (connection,
"/org/a11y/bus",
@@ -734,6 +724,18 @@ on_name_acquired (GDBusConnection *connection,
const gchar *name,
gpointer user_data)
{
+ A11yBusLauncher *app = user_data;
+
+ if (app->launch_immediately)
+ {
+ ensure_a11y_bus (app);
+ if (app->state == A11Y_BUS_STATE_ERROR)
+ {
+ g_main_loop_quit (app->loop);
+ return;
+ }
+ }
+
g_bus_watch_name (G_BUS_TYPE_SESSION,
"org.gnome.SessionManager",
G_BUS_NAME_WATCHER_FLAGS_NONE,