mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	X11: Add xauthority parameter
Add an xauthority parameter and use it in the startup script. Apparently on some systems the X authentication cookie is not stored in ~/.Xauthority but in some dynamic location pointed to by the XAUTHORITY environment variable. The environment variable therefore needs to be set in the PulseAudio daemon environment in order to have access to the X server from the PulseAudio daemon, but the variable is not necessarily set when starting PulseAudio. For example, systemd starts PulseAudio outside the X session. The start-pulseaudio-x11 script is run in the X session, so it has the environment variable available, and can pass it to the X modules, which then can set the variable in the daemon environment. RedHat bug: https://bugzilla.redhat.com/show_bug.cgi?id=1723065 Debian bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=593746 Based on patch by Alexander Kurtz <kurtz.alex@googlemail.com>
This commit is contained in:
		
							parent
							
								
									6f28865950
								
							
						
					
					
						commit
						c7a55174dc
					
				
					 5 changed files with 35 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -46,6 +46,7 @@ PA_MODULE_USAGE("display=<X11 display>");
 | 
			
		|||
 | 
			
		||||
static const char* const valid_modargs[] = {
 | 
			
		||||
    "display",
 | 
			
		||||
    "xauthority",
 | 
			
		||||
    NULL
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -128,6 +129,13 @@ int pa__init(pa_module *m) {
 | 
			
		|||
    m->userdata = u = pa_xnew0(struct userdata, 1);
 | 
			
		||||
    u->module = m;
 | 
			
		||||
 | 
			
		||||
    if (pa_modargs_get_value(ma, "xauthority", NULL)) {
 | 
			
		||||
        if (setenv("XAUTHORITY", pa_modargs_get_value(ma, "xauthority", NULL), 1)) {
 | 
			
		||||
            pa_log("setenv() for $XAUTHORITY failed");
 | 
			
		||||
            goto fail;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (!(u->x11_wrapper = pa_x11_wrapper_get(m->core, pa_modargs_get_value(ma, "display", NULL))))
 | 
			
		||||
        goto fail;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue