mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-10-29 05:40:12 -04:00 
			
		
		
		
	xwayland: preserve the PATH variable
Some systems don't have xwayland in /usr/bin, but in other paths. wlroots was unable to find Xwayland binaries outside of standard locations
This commit is contained in:
		
							parent
							
								
									4b2f56cc01
								
							
						
					
					
						commit
						a470f101c1
					
				
					 1 changed files with 2 additions and 0 deletions
				
			
		|  | @ -103,6 +103,7 @@ static void exec_xwayland(struct wlr_xwayland *wlr_xwayland) { | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	const char *xdg_runtime = getenv("XDG_RUNTIME_DIR"); | 	const char *xdg_runtime = getenv("XDG_RUNTIME_DIR"); | ||||||
|  | 	const char *path_var = getenv("PATH"); | ||||||
| 	if (!xdg_runtime) { | 	if (!xdg_runtime) { | ||||||
| 		wlr_log(L_ERROR, "XDG_RUNTIME_DIR is not set"); | 		wlr_log(L_ERROR, "XDG_RUNTIME_DIR is not set"); | ||||||
| 		_exit(EXIT_FAILURE); | 		_exit(EXIT_FAILURE); | ||||||
|  | @ -113,6 +114,7 @@ static void exec_xwayland(struct wlr_xwayland *wlr_xwayland) { | ||||||
| 		_exit(EXIT_FAILURE); | 		_exit(EXIT_FAILURE); | ||||||
| 	} | 	} | ||||||
| 	setenv("XDG_RUNTIME_DIR", xdg_runtime, true); | 	setenv("XDG_RUNTIME_DIR", xdg_runtime, true); | ||||||
|  | 	setenv("PATH", path_var, true); | ||||||
| 	char wayland_socket_str[16]; | 	char wayland_socket_str[16]; | ||||||
| 	snprintf(wayland_socket_str, sizeof(wayland_socket_str), "%d", wlr_xwayland->wl_fd[1]); | 	snprintf(wayland_socket_str, sizeof(wayland_socket_str), "%d", wlr_xwayland->wl_fd[1]); | ||||||
| 	setenv("WAYLAND_SOCKET", wayland_socket_str, true); | 	setenv("WAYLAND_SOCKET", wayland_socket_str, true); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 n3rdopolis
						n3rdopolis