From 9b1d66cbf46740444daae2629cb0725bac1f11b3 Mon Sep 17 00:00:00 2001 From: Marco Trevisan Date: Sat, 25 Nov 2023 02:11:59 +0100 Subject: [PATCH] snap: Make native wayland client support configurable Make possible for users to enable the native wayland client by using snap set mailspring wayland-native=true By default mailspring will use xwayland, but the support can be toggled by users with the said command. --- snap/hooks/configure | 7 +++++++ snap/launcher | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 snap/hooks/configure diff --git a/snap/hooks/configure b/snap/hooks/configure new file mode 100644 index 0000000000..74f77985bb --- /dev/null +++ b/snap/hooks/configure @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +set -eu + +wayland_native="$(snapctl get wayland-native)" +if [[ -z "$wayland_native" ]]; then + snapctl set wayland-native=true +fi diff --git a/snap/launcher b/snap/launcher index f9337a2107..d3def4cebd 100644 --- a/snap/launcher +++ b/snap/launcher @@ -2,7 +2,8 @@ if [ -n "$WAYLAND_DISPLAY" ] && \ [ "${DISABLE_WAYLAND:-0}" = 0 ] && \ - [ "${GDK_BACKEND:-wayland}" = "wayland" ]; then + [ "${GDK_BACKEND:-wayland}" = "wayland" ] && \ + [ "$(snapctl get wayland-native)" != "false" ]; then args="--enable-features=WaylandWindowDecorations --ozone-platform=wayland --use-gl=desktop" fi