Commit b68e60b7 authored by Carlos Garnacho's avatar Carlos Garnacho

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
!12
parent ffba513d
......@@ -1601,7 +1601,8 @@ atspi_get_a11y_bus (void)
if (address_env != NULL && *address_env != 0)
address = g_strdup (address_env);
#ifdef HAVE_X11
if (!address && g_strcmp0 (g_getenv ("XDG_SESSION_TYPE"), "x11") == 0)
if (!address && g_getenv ("DISPLAY") != NULL &&
g_getenv ("WAYLAND_DISPLAY") == NULL)
address = get_accessibility_bus_address_x11 ();
#endif
if (!address)
......
......@@ -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)
......
......@@ -1856,7 +1856,7 @@ spi_device_event_controller_class_init (SpiDEControllerClass *klass)
object_class->finalize = spi_device_event_controller_object_finalize;
#ifdef HAVE_X11
if (g_strcmp0 (g_getenv ("XDG_SESSION_TYPE"), "x11") == 0)
if (g_getenv ("DISPLAY") != NULL && g_getenv ("WAYLAND_DISPLAY") == NULL)
spi_dec_setup_x11 (klass);
else
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment