mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-31 22:25:33 -04:00
client-conf: Check XDG_SESSION_TYPE
If systemd is in use, the XDG_SESSION_TYPE will probably be set (usually
to "wayland", "x11", or "tty"). If XDG_SESSION_TYPE is set to something
other than "wayland", connect to the X11 server to request properties.
Commit 79a8efb45c stopped connecting to
the X server unless SSH_CONNECTION is set in the environment, to avoid
launching a useless xwayland process. However, there are many more
circumstances in which a remote X server may be in use. For example,
XDMCP or VNC.
This does not completely fix #1412, but it does improve the situation.
This commit is contained in:
parent
96bd4e57b5
commit
361be0b5a1
1 changed files with 13 additions and 5 deletions
|
|
@ -43,14 +43,22 @@ int pa_client_conf_from_x11(pa_client_conf *c) {
|
||||||
|
|
||||||
pa_assert(c);
|
pa_assert(c);
|
||||||
|
|
||||||
/* Local connections will have configuration and X root window
|
/* Xwayland is expensive to start. Do not check for X11 properties
|
||||||
* properties match 1:1, these paths are only strictly necessary
|
* if the session is primarily a Wayland session
|
||||||
* for remote clients, so check for SSH_CONNECTION to make sure
|
|
||||||
* this is a remote session with X forwarding.
|
|
||||||
*/
|
*/
|
||||||
if (!getenv("SSH_CONNECTION"))
|
const char *xdg_session_type = getenv("XDG_SESSION_TYPE");
|
||||||
|
if (xdg_session_type && !strcmp(xdg_session_type, "wayland"))
|
||||||
goto finish;
|
goto finish;
|
||||||
|
|
||||||
|
if (!xdg_session_type) {
|
||||||
|
/* If XDG_SESSION_TYPE is not set, it might still be a wayland session
|
||||||
|
* running under an older systemd (or not running under systemd at all).
|
||||||
|
* Only check X11 properties if we're running under ssh.
|
||||||
|
*/
|
||||||
|
if (!getenv("SSH_CONNECTION"))
|
||||||
|
goto finish;
|
||||||
|
}
|
||||||
|
|
||||||
if (!(dname = getenv("DISPLAY")))
|
if (!(dname = getenv("DISPLAY")))
|
||||||
goto finish;
|
goto finish;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue