]> code.delx.au - pulseaudio/blobdiff - src/pulse/context.c
client: introduce auto-connect-display= following the scheme of auto-connect-localhost=
[pulseaudio] / src / pulse / context.c
index 85b90ac7e6f35dcad21e46d791293e68ce8ac4a7..83e0dbb5514c879407f8863c50b4b5b8e6a1f3f2 100644 (file)
@@ -987,13 +987,15 @@ int pa_context_connect(
         /* Prepend in reverse order */
 
         /* Follow the X display */
-        if ((d = getenv("DISPLAY"))) {
-            d = pa_xstrndup(d, strcspn(d, ":"));
+        if (c->conf->auto_connect_display) {
+            if ((d = getenv("DISPLAY"))) {
+                d = pa_xstrndup(d, strcspn(d, ":"));
 
-            if (*d)
-                c->server_list = pa_strlist_prepend(c->server_list, d);
+                if (*d)
+                    c->server_list = pa_strlist_prepend(c->server_list, d);
 
-            pa_xfree(d);
+                pa_xfree(d);
+            }
         }
 
         /* Add TCP/IP on the localhost */