summaryrefslogtreecommitdiff
path: root/atspi/atspi-misc.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2017-08-31 17:06:13 +0200
committerMike Gorse <mgorse@suse.com>2017-09-04 17:27:40 -0500
commit0cce560e437e39daf04e0dd60b38f6c313c7112a (patch)
tree73482a7ec660789227813464fd8e35dcc4217d32 /atspi/atspi-misc.c
parent15140f5a10127ef50c73230b395991efb9ab3219 (diff)
downloadat-spi2-core-0cce560e437e39daf04e0dd60b38f6c313c7112a.tar.gz
Optionally read the dbus address from env var AT_SPI_BUS_ADDRESS
This will be used for flatpak to set a custom bus (which is really the bus proxy). It can be used for testing purposes too. For more details, see https://github.com/flatpak/flatpak/issues/79 https://bugzilla.gnome.org/show_bug.cgi?id=787126
Diffstat (limited to 'atspi/atspi-misc.c')
-rw-r--r--atspi/atspi-misc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/atspi/atspi-misc.c b/atspi/atspi-misc.c
index 46d1c114..eebbed4d 100644
--- a/atspi/atspi-misc.c
+++ b/atspi/atspi-misc.c
@@ -1577,6 +1577,7 @@ atspi_get_a11y_bus (void)
{
DBusError error;
char *address = NULL;
+ const char *address_env = NULL;
if (a11y_bus && dbus_connection_get_is_connected (a11y_bus))
return a11y_bus;
@@ -1585,8 +1586,12 @@ atspi_get_a11y_bus (void)
if (!dbus_connection_allocate_data_slot (&a11y_dbus_slot))
g_warning ("at-spi: Unable to allocate D-Bus slot");
+ address_env = g_getenv ("AT_SPI_BUS_ADDRESS");
+ if (address_env != NULL && *address_env != 0)
+ address = g_strdup (address_env);
#ifdef HAVE_X11
- address = get_accessibility_bus_address_x11 ();
+ if (!address)
+ address = get_accessibility_bus_address_x11 ();
#endif
if (!address)
address = get_accessibility_bus_address_dbus ();