diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/pulse/client-conf.c | 4 | ||||
-rw-r--r-- | src/pulse/client-conf.h | 2 | ||||
-rw-r--r-- | src/pulse/client.conf.in | 1 | ||||
-rw-r--r-- | src/pulse/context.c | 12 |
4 files changed, 12 insertions, 7 deletions
diff --git a/src/pulse/client-conf.c b/src/pulse/client-conf.c index 6c97802b..18fafe34 100644 --- a/src/pulse/client-conf.c +++ b/src/pulse/client-conf.c @@ -63,7 +63,8 @@ static const pa_client_conf default_conf = { .cookie_file = NULL, .cookie_valid = FALSE, .shm_size = 0, - .auto_connect_localhost = FALSE + .auto_connect_localhost = FALSE, + .auto_connect_display = FALSE }; pa_client_conf *pa_client_conf_new(void) { @@ -107,6 +108,7 @@ int pa_client_conf_load(pa_client_conf *c, const char *filename) { { "enable-shm", pa_config_parse_not_bool, &c->disable_shm, NULL }, { "shm-size-bytes", pa_config_parse_size, &c->shm_size, NULL }, { "auto-connect-localhost", pa_config_parse_bool, &c->auto_connect_localhost, NULL }, + { "auto-connect-display", pa_config_parse_bool, &c->auto_connect_display, NULL }, { NULL, NULL, NULL, NULL }, }; diff --git a/src/pulse/client-conf.h b/src/pulse/client-conf.h index 3bca8fdd..f281f4eb 100644 --- a/src/pulse/client-conf.h +++ b/src/pulse/client-conf.h @@ -29,7 +29,7 @@ typedef struct pa_client_conf { char *daemon_binary, *extra_arguments, *default_sink, *default_source, *default_server, *default_dbus_server, *cookie_file; - pa_bool_t autospawn, disable_shm, auto_connect_localhost; + pa_bool_t autospawn, disable_shm, auto_connect_localhost, auto_connect_display; uint8_t cookie[PA_NATIVE_COOKIE_LENGTH]; pa_bool_t cookie_valid; /* non-zero, when cookie is valid */ size_t shm_size; diff --git a/src/pulse/client.conf.in b/src/pulse/client.conf.in index 090713ec..436747bc 100644 --- a/src/pulse/client.conf.in +++ b/src/pulse/client.conf.in @@ -34,3 +34,4 @@ ; shm-size-bytes = 0 # setting this 0 will use the system-default, usually 64 MiB ; auto-connect-localhost = no +; auto-connect-display = no diff --git a/src/pulse/context.c b/src/pulse/context.c index 85b90ac7..83e0dbb5 100644 --- a/src/pulse/context.c +++ b/src/pulse/context.c @@ -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 */ |