From ecfe3feb3b4d0f37f369ddc51419441eddd61c35 Mon Sep 17 00:00:00 2001 From: Jose Castillo Lema Date: Wed, 12 Jul 2023 16:10:28 +0200 Subject: [PATCH] Native wayland support --- code.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/code.sh b/code.sh index 25fc745..a76a051 100755 --- a/code.sh +++ b/code.sh @@ -438,8 +438,14 @@ existing=$($flatpak ps --columns=instance,application,pid | sort -nr | \ if [ "$existing" = "" ] ; then verbose "No running Visual Studio Code Flatpak, will use 'flatpak run'" $verbose && set -x - $flatpak run com.visualstudio.code \ - --remote attached-container+"$container_name_encoded" "${new_args[@]}" + if [[ $XDG_SESSION_TYPE == "wayland" ]]; then + $flatpak run --socket=wayland com.visualstudio.code \ + --remote attached-container+"$container_name_encoded" "${new_args[@]}" \ + --ozone-platform-hint=wayland + else + $flatpak run com.visualstudio.code \ + --remote attached-container+"$container_name_encoded" "${new_args[@]}" + fi else verbose "Found running Visual Studio Code Flatpak, will use 'flatpak enter'" # flatpak enter tries to read the environment from the running process,