summaryrefslogtreecommitdiff
path: root/atspi/atspi-misc.c
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2019-05-06 16:12:00 +0200
committerCarlos Garnacho <carlosg@gnome.org>2019-05-06 16:12:00 +0200
commit3bb820723334a5903d0705801b04025bed055292 (patch)
tree33cf18376cf0eb27f598b1522ce01bafb7602faa /atspi/atspi-misc.c
parent25f1cc6c3e9138e3f27f4879a20546e0c56d4b6b (diff)
downloadat-spi2-core-3bb820723334a5903d0705801b04025bed055292.tar.gz
Do not rely on getenv("DISPLAY")!=NULL to assume it is a X11 environment
Change/add checks around the AT_SPI_BUS root window property handling so it is only done if the session is a real X11 one. These checks used to work on wayland sessions, as there still is a X server to poke, it's strange to use as a side channel but that's about it. However in the future mutter will start Xwayland on demand, the DISPLAY environment variable will definitely exist so checking for it is definitely not sufficient, and opening the display will unintendedly spawn Xwayland. It is debatable that this should happen in Wayland sessions at all, so let the org.a11y.Bus fallbacks take over.
Diffstat (limited to 'atspi/atspi-misc.c')
-rw-r--r--atspi/atspi-misc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/atspi/atspi-misc.c b/atspi/atspi-misc.c
index f0c8fdc8..8d708496 100644
--- a/atspi/atspi-misc.c
+++ b/atspi/atspi-misc.c
@@ -1601,7 +1601,7 @@ atspi_get_a11y_bus (void)
if (address_env != NULL && *address_env != 0)
address = g_strdup (address_env);
#ifdef HAVE_X11
- if (!address)
+ if (!address && g_strcmp0 (g_getenv ("XDG_SESSION_TYPE"), "x11") == 0)
address = get_accessibility_bus_address_x11 ();
#endif
if (!address)