summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorPeter Kaplan <peter@pkap.de>2022-07-28 21:41:19 +0200
committerPeter Kaplan <peter@pkap.de>2022-07-28 21:41:19 +0200
commite0548c2cce8bfbc98d130819e5c76d9b8cccb786 (patch)
tree58b56ebfd99b85c446eba56a66545e5c1a3c45a1
parent6e3abe26e019682d90e7e14c6c5c974a423298cf (diff)
downloadmullvadvpn-e0548c2cce8bfbc98d130819e5c76d9b8cccb786.tar.xz
mullvadvpn-e0548c2cce8bfbc98d130819e5c76d9b8cccb786.zip
Electron flags to run wayland native
To make sure this is only applied on desktops/compositors that are supported and well-tested, the running desktop/compositor is checked against a predefined allowlist via environment variables that are commonly set by desktop environments or compositors.
-rw-r--r--CHANGELOG.md3
-rwxr-xr-xdist-assets/linux/mullvad-gui-launcher.sh12
2 files changed, 14 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 84e9cef550..18a851eea1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -35,6 +35,9 @@ Line wrap the file at 100 chars. Th
default 1500. The 1500 is still the fallback if this for some reason fails. This may stop
fragmentation.
+#### Linux
+- GUI: Add electron flags to run Wayland native if in a compositor/desktop known to work well
+
### Changed
- Reject invalid WireGuard ports in the CLI.
- Reorganize settings into more logical categories.
diff --git a/dist-assets/linux/mullvad-gui-launcher.sh b/dist-assets/linux/mullvad-gui-launcher.sh
index 32be5868ca..51c8e8e062 100755
--- a/dist-assets/linux/mullvad-gui-launcher.sh
+++ b/dist-assets/linux/mullvad-gui-launcher.sh
@@ -8,5 +8,15 @@ else
SANDBOX_FLAG=""
fi
+SUPPORTED_COMPOSITORS="sway river"
+if [ "${XDG_SESSION_TYPE:-""}" = "wayland" ] && \
+ echo " $SUPPORTED_COMPOSITORS " | \
+ grep -qi -e " ${XDG_CURRENT_DESKTOP:-""} " -e " ${XDG_SESSION_DESKTOP:-""} "
+then
+ WAYLAND_FLAGS="--ozone-platform=wayland --enable-features=WaylandWindowDecorations"
+else
+ WAYLAND_FLAGS=""
+fi
+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-exec "$SCRIPT_DIR/mullvad-gui" $SANDBOX_FLAG "$@"
+exec "$SCRIPT_DIR/mullvad-gui" $SANDBOX_FLAG $WAYLAND_FLAGS "$@"