From b68e60b75f4f6741da156d143c242b4a177a6434 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Tue, 21 May 2019 15:59:37 +0200 Subject: 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 --- bus/at-spi-bus-launcher.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bus') 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) -- cgit v1.2.1