[at-spi2-core: 2/4] at-spi-bus-launcher: Only clear AT_SPI_BUS X prop when having set it



commit 1e43ac742c7622beaa40902777a017efa3af2402
Author: Samuel Thibault <samuel thibault ens-lyon org>
Date:   Fri Sep 6 03:39:30 2019 +0200

    at-spi-bus-launcher: Only clear AT_SPI_BUS X prop when having set it
    
    In case where bus name acquisition fails, we shall not drop the
    AT_SPI_BUS X property of the existing daemon.

 bus/at-spi-bus-launcher.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/bus/at-spi-bus-launcher.c b/bus/at-spi-bus-launcher.c
index 57727c1..af85f04 100644
--- a/bus/at-spi-bus-launcher.c
+++ b/bus/at-spi-bus-launcher.c
@@ -63,6 +63,9 @@ typedef struct {
   /* -1 == error, 0 == pending, > 0 == running */
   int a11y_bus_pid;
   char *a11y_bus_address;
+#ifdef HAVE_X11
+  gboolean x11_prop_set;
+#endif
   int pipefd[2];
   int listenfd;
   char *a11y_launch_error_message;
@@ -480,6 +483,7 @@ ensure_a11y_bus (A11yBusLauncher *app)
                            (guchar *) app->a11y_bus_address, strlen (app->a11y_bus_address));
           XFlush (display);
           XCloseDisplay (display);
+          app->x11_prop_set = TRUE;
         }
     }
 #endif
@@ -886,7 +890,7 @@ main (int    argc,
    * we don't want early login processes to pick up the stale address.
    */
 #ifdef HAVE_X11
-  if (g_getenv ("DISPLAY") != NULL && g_getenv ("WAYLAND_DISPLAY") == NULL)
+  if (_global_app->x11_prop_set)
     {
       Display *display = XOpenDisplay (NULL);
       if (display)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]