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.
This commit is contained in:
Marco Trevisan 2023-11-25 02:11:59 +01:00 committed by Marco Trevisan (Treviño)
parent bbfd589e09
commit 119e847545
2 changed files with 10 additions and 3 deletions

7
snap/hooks/configure vendored Normal file
View file

@ -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=false
fi

View file

@ -1,8 +1,8 @@
#!/bin/sh
if [ -n "$WAYLAND_DISPLAY" ] && \
[ "${DISABLE_WAYLAND:-0}" = 0 ] && \
[ "${GDK_BACKEND:-wayland}" = "wayland" ]; then
if [ "${DISABLE_WAYLAND:-0}" = 0 ] && \
[ "${GDK_BACKEND:-wayland}" = "wayland" ] && \
[ "$(snapctl get wayland-native)" = "true" ]; then
args="--enable-features=WaylandWindowDecorations --ozone-platform=wayland"
fi