summaryrefslogtreecommitdiff
path: root/bus
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2019-05-21 15:59:37 +0200
committerCarlos Garnacho <carlosg@gnome.org>2019-05-21 16:16:30 +0200
commitb68e60b75f4f6741da156d143c242b4a177a6434 (patch)
treef44155f4de7b2a306edae42f828e05ff9f0a7246 /bus
parentffba513d3c4a275fd665c0cbc4fb9e148eb4d258 (diff)
downloadat-spi2-core-b68e60b75f4f6741da156d143c242b4a177a6434.tar.gz
Resort to WAYLAND_DISPLAY checks to avoid X11 connections
Same reasoning applies (Opening and closing X11 displays may be from ineffective to harmful there), but the XDG_SESSION_TYPE check breaks for startx. Explicitly check that DISPLAY is present but WAYLAND_DISPLAY is not, in order to avoid this behavior. Pointed out at https://gitlab.gnome.org/GNOME/at-spi2-core/merge_requests/12
Diffstat (limited to 'bus')
-rw-r--r--bus/at-spi-bus-launcher.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bus/at-spi-bus-launcher.c b/bus/at-spi-bus-launcher.c
index 98f4114c..436e6a39 100644
--- a/bus/at-spi-bus-launcher.c
+++ b/bus/at-spi-bus-launcher.c
@@ -466,7 +466,7 @@ ensure_a11y_bus (A11yBusLauncher *app)
#endif
#ifdef HAVE_X11
- if (g_strcmp0 (g_getenv ("XDG_SESSION_TYPE"), "x11") == 0)
+ if (g_getenv ("DISPLAY") != NULL && g_getenv ("WAYLAND_DISPLAY") == NULL)
{
Display *display = XOpenDisplay (NULL);
if (display)
@@ -885,7 +885,7 @@ main (int argc,
* we don't want early login processes to pick up the stale address.
*/
#ifdef HAVE_X11
- if (g_strcmp0 (g_getenv ("XDG_SESSION_TYPE"), "x11") == 0)
+ if (g_getenv ("DISPLAY") != NULL && g_getenv ("WAYLAND_DISPLAY") == NULL)
{
Display *display = XOpenDisplay (NULL);
if (display)