diff --git a/.github/workflows/publish-nym-wallet-ubuntu.yml b/.github/workflows/publish-nym-wallet-ubuntu.yml index 0c3b338d9e..3fdc95939e 100644 --- a/.github/workflows/publish-nym-wallet-ubuntu.yml +++ b/.github/workflows/publish-nym-wallet-ubuntu.yml @@ -87,13 +87,14 @@ jobs: EXTRACT_DIR=$(mktemp -d) cd "${EXTRACT_DIR}" "${APPIMAGE_ABS}" --appimage-extract + # Tauri only stages appimage "files" under /usr/ into the AppDir; paths like /apprun-hooks/ never reach the image. + # Wayland + WEBKIT_DISABLE_DMABUF_RENDERER defaults are applied in main() instead (see configure_linux_wayland_defaults). HOOK=$(find squashfs-root -name '99-nym-wayland.sh' 2>/dev/null | head -n 1) - if [ -z "${HOOK}" ]; then - echo "apprun-hooks/99-nym-wayland.sh not found; listing squashfs-root:" - find squashfs-root -type f 2>/dev/null | head -80 || true - exit 1 + if [ -n "${HOOK}" ]; then + echo "Found legacy apprun hook at ${HOOK}" + else + echo "No apprun-hooks/99-nym-wayland.sh (expected): Wayland defaults are set in-process." fi - echo "Found Wayland hook at ${HOOK}" find squashfs-root/usr/lib -maxdepth 6 \ \( -name 'libwayland-client.so*' -o -name 'libEGL.so*' -o -name 'libgbm.so*' \) \ 2>/dev/null | sort > "${GITHUB_WORKSPACE}/nym-wallet/appimage-bundled-graphics-libs.txt" diff --git a/nym-wallet/README.md b/nym-wallet/README.md index db137d296d..55bca32258 100644 --- a/nym-wallet/README.md +++ b/nym-wallet/README.md @@ -19,9 +19,9 @@ The Nym desktop wallet enables you to use the Nym network and take advantage of Some rolling distributions (for example Arch-based) or Wayland compositors can hit WebKitGTK / EGL errors at startup (for example `EGL_BAD_PARAMETER`, `EGL_BAD_ALLOC`, or `Could not create default EGL display`). -**AppImage (Wayland):** The bundle installs an AppRun hook that preloads the system `libwayland-client` when possible, sets `GDK_BACKEND`, `GDK_SCALE`, `GDK_DPI_SCALE`, and defaults `WEBKIT_DISABLE_DMABUF_RENDERER=1`. Override if needed: `WEBKIT_DISABLE_DMABUF_RENDERER=0`, or set your own `GDK_*` / `LD_PRELOAD` before launching. +**Wayland (all Linux bundles, including AppImage):** On startup, when `WAYLAND_DISPLAY` is set, the wallet sets `GDK_BACKEND`, `GDK_SCALE`, `GDK_DPI_SCALE`, and defaults `WEBKIT_DISABLE_DMABUF_RENDERER=1` before the webview initializes. Override if needed: `WEBKIT_DISABLE_DMABUF_RENDERER=0`, or set your own `GDK_*` / `LD_PRELOAD` before launching. (Tauri’s AppImage bundler only copies paths under `/usr/` into the image, so an `apprun-hooks/` file in config would not be included; defaults live in `main()` instead.) -**`.deb`, installed binary, or `target/release` binary:** Use the same variables in a wrapper script or in a `.desktop` file, for example: +**`.deb`, installed binary, or `target/release` binary:** You can also set the same variables in a wrapper script or `.desktop` file, for example: `Exec=env WEBKIT_DISABLE_DMABUF_RENDERER=1 GDK_BACKEND=wayland GDK_SCALE=1 GDK_DPI_SCALE=0.8 /path/to/NymWallet` diff --git a/nym-wallet/src-tauri/scripts/appimage-wayland-hook.sh b/nym-wallet/src-tauri/scripts/appimage-wayland-hook.sh index 8bd22e8f25..d046bc8042 100644 --- a/nym-wallet/src-tauri/scripts/appimage-wayland-hook.sh +++ b/nym-wallet/src-tauri/scripts/appimage-wayland-hook.sh @@ -1,4 +1,6 @@ #!/usr/bin/env bash +# Reference only: Tauri AppImage bundling does not place /apprun-hooks/ into the final image (only /usr/ is staged). +# Wayland defaults and WEBKIT_DISABLE_DMABUF_RENDERER are applied in src/main.rs (configure_linux_wayland_defaults). if [ -z "${WAYLAND_DISPLAY:-}" ]; then return 0 2>/dev/null || exit 0 diff --git a/nym-wallet/src-tauri/src/main.rs b/nym-wallet/src-tauri/src/main.rs index ad37a00ecd..e03c36765a 100644 --- a/nym-wallet/src-tauri/src/main.rs +++ b/nym-wallet/src-tauri/src/main.rs @@ -251,6 +251,9 @@ fn configure_linux_wayland_defaults() { if std::env::var_os("GDK_DPI_SCALE").is_none() { unsafe { std::env::set_var("GDK_DPI_SCALE", "0.8") }; } + if std::env::var_os("WEBKIT_DISABLE_DMABUF_RENDERER").is_none() { + unsafe { std::env::set_var("WEBKIT_DISABLE_DMABUF_RENDERER", "1") }; + } } } } diff --git a/nym-wallet/src-tauri/tauri.conf.json b/nym-wallet/src-tauri/tauri.conf.json index 29c5400e6d..455b1af35c 100644 --- a/nym-wallet/src-tauri/tauri.conf.json +++ b/nym-wallet/src-tauri/tauri.conf.json @@ -27,9 +27,7 @@ }, "linux": { "appimage": { - "files": { - "/apprun-hooks/99-nym-wayland.sh": "scripts/appimage-wayland-hook.sh" - } + "bundleMediaFramework": false }, "deb": { "depends": []