[Portland] [PATCH] Check also for $WAYLAND_DISPLAY in xdg-open and xdg-email

Per Olofsson pelle at debian.org
Tue Nov 3 11:37:41 PST 2015


Hi,

Thanks! I committed a similar change now but with a new has_display()
function instead.


Den 2015-11-03 kl. 19:13, skrev pasi.sjoholm at jolla.com:
> From: Pasi Sjöholm <pasi.sjoholm at jollamobile.com>
> 
> It is necessary to check for $WAYLAND_DISPLAY as well as $DISPLAY
> as introduced by commit e52dffacc1f67daede2abeec327367b995c294bc.
> Othewise systems running Wayland and not X will be "broken".
> ---
>  scripts/xdg-email.in | 2 +-
>  scripts/xdg-open.in  | 8 ++++----
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/scripts/xdg-email.in b/scripts/xdg-email.in
> index 2819e28..ce30a59 100644
> --- a/scripts/xdg-email.in
> +++ b/scripts/xdg-email.in
> @@ -433,7 +433,7 @@ fi
>  # if BROWSER variable is not set, check some well known browsers instead
>  if [ x"$BROWSER" = x"" ]; then
>      BROWSER=www-browser:links2:elinks:links:lynx:w3m
> -    if [ -n "$DISPLAY" ]; then
> +    if [ -n "$DISPLAY" -o -n "$WAYLAND_DISPLAY" ]; then
>          BROWSER=x-www-browser:firefox:iceweasel:seamonkey:mozilla:epiphany:konqueror:chromium-browser:google-chrome:$BROWSER
>      fi
>  fi
> diff --git a/scripts/xdg-open.in b/scripts/xdg-open.in
> index 0fbd63d..dbf2f95 100644
> --- a/scripts/xdg-open.in
> +++ b/scripts/xdg-open.in
> @@ -348,7 +348,7 @@ open_generic()
>  
>          check_input_file "$file"
>  
> -        if [ -n "$DISPLAY" ]; then
> +        if [ -n "$DISPLAY" -o -n "$WAYLAND_DISPLAY" ]; then
>              filetype=`xdg-mime query filetype "$file" | sed "s/;.*//"`
>              open_generic_xdg_mime "$file" "$filetype"
>          fi
> @@ -360,7 +360,7 @@ open_generic()
>              fi
>          fi
>  
> -        if [ -n "$DISPLAY" ] && mimeopen -v 2>/dev/null 1>&2; then
> +        if [ -n "$DISPLAY" -o -n "$WAYLAND_DISPLAY" ] && mimeopen -v 2>/dev/null 1>&2; then
>              mimeopen -L -n "$file"
>              if [ $? -eq 0 ]; then
>                  exit_success
> @@ -372,14 +372,14 @@ open_generic()
>          open_envvar "$1"
>      fi
>  
> -    if [ -n "$DISPLAY" ]; then
> +    if [ -n "$DISPLAY" -o -n "$WAYLAND_DISPLAY" ]; then
>          open_generic_xdg_x_scheme_handler "$1"
>      fi
>  
>      # if BROWSER variable is not set, check some well known browsers instead
>      if [ x"$BROWSER" = x"" ]; then
>          BROWSER=www-browser:links2:elinks:links:lynx:w3m
> -        if [ -n "$DISPLAY" ]; then
> +        if [ -n "$DISPLAY" -o -n "$WAYLAND_DISPLAY" ]; then
>              BROWSER=x-www-browser:firefox:iceweasel:seamonkey:mozilla:epiphany:konqueror:chromium-browser:google-chrome:$BROWSER
>          fi
>      fi
> 


-- 
Pelle


More information about the Portland mailing list