fix(linux): work around WebKitGTK white screen on AppImage + Wayland - #28
Merged
Merged
Conversation
linuxdeploy bundles the build machine's libwayland-client.so into the AppImage, which shadows the host's newer copy on Wayland (Arch/CachyOS) and breaks EGL init (EGL_BAD_PARAMETER) -> blank/white window, or a silent fallback to Xwayland that also explains the jank vs. Windows. Separately, WebKitGTK's DMA-BUF compositor is broken on many NVIDIA+Wayland setups. Confirmed root cause and fix by building the AppImage and reproducing on a real CachyOS/NVIDIA/Wayland machine, where the prior workaround was manually setting LD_PRELOAD before launch. linux_gfx::apply_startup_workarounds() runs first thing in run() and, unless the user already set the relevant env var: sets WEBKIT_DISABLE_DMABUF_RENDERER=1 under AppImage or NVIDIA, and under AppImage+Wayland re-execs once via /proc/self/exe with the system libwayland-client preloaded (ELF-arch-checked, loop-guarded). Opt-out via VOLTIUS_NO_LINUX_GFX_WORKAROUNDS=1.
ezhkov-ph
force-pushed
the
fix/linux-appimage-wayland
branch
from
July 14, 2026 20:13
67e9306 to
8d870d9
Compare
Contributor
|
Thanks a lot for this, Alex — really thorough work. The two-root-cause breakdown (bundled libwayland + DMABUF renderer) and the ELF-validated preload are exactly the right way to handle it, and the doc comments made review easy. I checked it out, built it in our CI image, and confirmed it compiles clean with the unit tests, fmt, and clippy all green. I pushed one tiny follow-up to your branch ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On some Linux setups (confirmed on CachyOS with an NVIDIA GPU under Wayland), launching the AppImage shows a blank/white window unless the user manually sets
LD_PRELOAD=/usr/lib/libwayland-client.sobefore running it. Users also reported noticeably janky/non-smooth rendering compared to the Windows build, even once the white screen was worked around.This is not a bug in Voltius's own code — there was no Linux-specific webview setup at all prior to this PR. It's a well-known WebKitGTK/AppImage packaging interaction that other Tauri apps (e.g. Yaak) have hit and worked around the same way.
Root causes (two independent issues)
Bundled
libwayland-client.soshadows the system one.linuxdeploy(used by the Tauri bundler) packages the build machine'slibwayland-client.so.0(Ubuntu 24.04 in our CI) into the AppImage as a WebKit dependency. On a host with a newer Wayland stack (Arch/CachyOS/Fedora), the bundled copy wins the library search order and EGL display creation fails (Could not create default EGL display: EGL_BAD_PARAMETER) — resulting in either a white window, or a silent fallback to Xwayland (which would also explain the reported jank, since it's no longer compositing natively).WebKitGTK's DMA-BUF renderer. WebKitGTK >= 2.42 composites through DMA-BUF by default, which is broken on many NVIDIA-proprietary-driver + Wayland combinations (and some Mesa/compositor combos). The ecosystem-standard fix is the
WEBKIT_DISABLE_DMABUF_RENDERER=1environment variable, which falls back to the older (still GPU-accelerated) EGL path.Fix
Added
src-tauri/src/linux_gfx.rs, wired in as the very first thingrun()does (before Tauri/WebKit touch anything):WEBKIT_DISABLE_DMABUF_RENDERER=1when running from an AppImage or when an NVIDIA driver is detected (/proc/driver/nvidiaor/sys/module/nvidia) — unless the user already set the variable themselves.WAYLAND_DISPLAYset) with no user-suppliedLD_PRELOAD, re-execs the process once (/proc/self/exe) with the system'slibwayland-clientpreloaded, picked from a list of standard Debian/Fedora/Arch paths. The candidate is validated by parsing its ELF header (class + machine) so a mismatched-arch library is never preloaded. A guard env var (VOLTIUS_WAYLAND_PRELOAD_ATTEMPTED) prevents re-exec loops if the preload doesn't help.VOLTIUS_NO_LINUX_GFX_WORKAROUNDS=1, and none of it compiles on non-Linux targets (#[cfg(target_os = "linux")]), so Windows/macOS/Android builds are untouched.Verification
LD_PRELOAD; with this fix, launches directly to a working, non-blank window. Log output confirmed the re-exec path engaged with the correct system library path (/usr/lib64/libwayland-client.so.0on their machine).cargo fmt --all --checkpasses; added unit tests for the ELF-header validation logic (rejects non-ELF files, wrong architecture/class, missing files; picks the first valid candidate from a list).Test plan
cargo fmt --all --check/cargo build --release(via Docker, Ubuntu 24.04)LD_PRELOADneeded