Skip to content

Commit

Permalink
Simplify logic to enable wayland ozone backend
Browse files Browse the repository at this point in the history
This uses the new environment variable `ELECTRON_OZONE_PLATFORM_HINT` [1],
which is available since electron v28 [2].

[1] https://www.electronjs.org/docs/latest/api/environment-variables#electron_ozone_platform_hint-linux
[2] electron/electron#39792
  • Loading branch information
xduugu committed Feb 26, 2024
1 parent 0131637 commit 1a3ab7b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions signal-desktop.sh
Expand Up @@ -4,7 +4,6 @@ EXTRA_ARGS=()

declare -i SIGNAL_USE_TRAY_ICON="${SIGNAL_USE_TRAY_ICON:-0}"
declare -i SIGNAL_START_IN_TRAY="${SIGNAL_START_IN_TRAY:-0}"
declare -i SIGNAL_USE_WAYLAND="${SIGNAL_USE_WAYLAND:-0}"
declare -i SIGNAL_DISABLE_GPU="${SIGNAL_DISABLE_GPU:-0}"
declare -i SIGNAL_DISABLE_GPU_SANDBOX="${SIGNAL_DISABLE_GPU_SANDBOX:-0}"

Expand All @@ -20,10 +19,8 @@ if [[ "${SIGNAL_START_IN_TRAY}" -eq 1 ]]; then
)
fi

if [[ "${SIGNAL_USE_WAYLAND}" -eq 1 && "${XDG_SESSION_TYPE}" == "wayland" ]]; then
EXTRA_ARGS+=(
"--ozone-platform=wayland"
)
if (( ${SIGNAL_USE_WAYLAND:-0} )); then
export ELECTRON_OZONE_PLATFORM_HINT="${ELECTRON_OZONE_PLATFORM_HINT:-auto}"
fi

if [[ "${SIGNAL_DISABLE_GPU}" -eq 1 ]]; then
Expand Down

0 comments on commit 1a3ab7b

Please sign in to comment.