From 0060bd8a655afb19dd6a7ab63d5505213b3b57d5 Mon Sep 17 00:00:00 2001 From: Giuseppe Fierro Date: Tue, 26 Sep 2023 15:24:10 +0200 Subject: [PATCH 1/2] code.sh: Add Electron flags for improved UX under Wayland --- code.sh | 18 ++++++++++++++++++ com.visualstudio.code.yaml | 1 + 2 files changed, 19 insertions(+) diff --git a/code.sh b/code.sh index de8d0ec..eb24aab 100755 --- a/code.sh +++ b/code.sh @@ -4,6 +4,7 @@ set -e shopt -s nullglob FIRST_RUN="${XDG_CONFIG_HOME}/flatpak-vscode-first-run" +WAYLAND_OPTS="" function msg() { echo "flatpak-vscode: $*" >&2 @@ -14,6 +15,22 @@ if [ ! -f ${FIRST_RUN} ]; then touch ${FIRST_RUN} fi +if [ ! -f ${FIRST_RUN} ]; then + WARNING_FILE="/app/share/vscode/flatpak-warning.txt" + touch ${FIRST_RUN} +fi + +if [[ $XDG_SESSION_TYPE == "wayland" && -e "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY" ]] +then + WAYLAND_OPTS="$WAYLAND_OPTS --ozone-platform-hint=auto --enable-features=WaylandWindowDecorations,WebRTCPipeWireCapturer" + if [ -c /dev/nvidia0 ] + then + WAYLAND_OPTS="$WAYLAND_OPTS --disable-gpu-sandbox" + fi +else + WAYLAND_OPTS="$WAYLAND_OPTS --enable-features=WebRTCPipeWireCapturer" +fi + PYTHON_SITEDIR=$(python3 < Date: Sat, 7 Oct 2023 10:54:47 +0200 Subject: [PATCH 2/2] Change permession socket=fallback-x11 --- com.visualstudio.code.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.visualstudio.code.yaml b/com.visualstudio.code.yaml index 7923273..fe524fc 100644 --- a/com.visualstudio.code.yaml +++ b/com.visualstudio.code.yaml @@ -12,8 +12,8 @@ finish-args: - --require-version=0.10.3 - --share=network - --share=ipc - - --socket=x11 - --socket=wayland + - --socket=fallback-x11 - --socket=pulseaudio - --socket=ssh-auth - --device=all