Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -14,6 +15,10 @@ if [ ! -f ${FIRST_RUN} ]; then
touch ${FIRST_RUN}
fi

if [ "$XDG_SESSION_TYPE" = "wayland" ]; then
WAYLAND_OPTS="--ozone-platform-hint=auto"
fi
Copy link
Copy Markdown

@owtaylor owtaylor Jul 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The outer check isn't necessary -- --ozone-platform-hint=auto means "Check if XDG_SESSION_TYPE=wayland, if so, use wayland, otherwise use x11". (Meaning WAYLAND_OPTS isn't necessary and the argument could be passed unconditionally.)


PYTHON_SITEDIR=$(python3 <<EOFPYTHON
import os
import site
Expand Down Expand Up @@ -67,4 +72,5 @@ fi
exec env ELECTRON_RUN_AS_NODE=1 PATH="${PATH}:${XDG_DATA_HOME}/node_modules/bin" \
/app/bin/zypak-wrapper.sh /app/extra/vscode/code /app/extra/vscode/resources/app/out/cli.js \
--ms-enable-electron-run-as-node --extensions-dir=${XDG_DATA_HOME}/vscode/extensions \
${WAYLAND_OPTS} \
"$@" ${WARNING_FILE}