commit:     2cbe881d42d6cab111df3655bff8f17b5f9efe88
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 15 14:13:50 2025 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Mon Dec 15 14:13:50 2025 +0000
URL:        
https://gitweb.gentoo.org/proj/prefix/prefix-toolkit.git/commit/?id=2cbe881d

startprefix: retain WAYLAND_DISPLAY when an absolute path

Relative paths require XDG_RUNTIME_DIR, but that may be set/overridden
by the Prefix itself.  Basically allow people who know what they are
doing to pass the socket through.

Bug: https://bugs.gentoo.org/915393
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 startprefix | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/startprefix b/startprefix
index f9aeaab..f928b93 100644
--- a/startprefix
+++ b/startprefix
@@ -1,5 +1,5 @@
 #!@GENTOO_PORTAGE_EBASH@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # Fabian Groffen <[email protected]> -- 2007-03-10
@@ -60,6 +60,10 @@ RETAIN="HOME=$HOME TERM=$TERM USER=$USER SHELL=$SHELL"
 [[ -n ${SSH_AUTH_SOCK} ]] && RETAIN+=" SSH_AUTH_SOCK=$SSH_AUTH_SOCK"
 # if we're on some X terminal, makes sense to inherit that too
 [[ -n ${DISPLAY} ]] && RETAIN+=" DISPLAY=$DISPLAY"
+# support Wayland but require it to be an absolute location, for
+# XDG_RUNTIME_DIR might be provided inside the Prefix itself #915393
+[[ -n ${WAYLAND_DISPLAY} && ${WAYLAND_DISPLAY} == /* ]] && \
+       RETAIN+=" WAYLAND_DISPLAY=$WAYLAND_DISPLAY"
 if [[ -d /proc/registry ]]; then # we're on Cygwin
        # crucial to Windows but cannot be restored, see
        # https://cygwin.com/ml/cygwin/2019-08/msg00072.html

Reply via email to