Skip to content

fix(linux): resolve wayland protocol error 71 and webkit dmabuf crashes - #21

Merged
EduTiyo merged 1 commit into
mainfrom
fix/linux-wayland-crash
Sep 23, 2026
Merged

EduTiyo merged 1 commit into
mainfrom
fix/linux-wayland-crash

Conversation

@EduTiyo

@EduTiyo EduTiyo commented Sep 23, 2026

Copy link
Copy Markdown
Owner

Summary

Resolves an issue on Linux distributions (such as Fedora) where launching the application immediately crashes with Gdk-Message: Error 71 (Protocol error) dispatching to Wayland display.

Root Cause

  1. Wayland Display Protocol Error (Error 71): On modern Linux desktop environments running Wayland (default on Fedora, GNOME, and KDE), Tauri's WebKitGTK integration can fail to dispatch to the Wayland display, causing an immediate crash upon launch.
  2. WebKitGTK DMA-BUF Instability: WebKitGTK's default DMA-BUF renderer frequently causes protocol violations, crashes, or blank windows across various graphics drivers (especially NVIDIA, Intel, and AMD with strict Wayland compositors).

Changes

  • Linux Environment Initialization (src-tauri/src/lib.rs):
    • Added ensure_linux_env() called at startup in run() prior to initializing Tauri and GTK.
    • Sets GDK_BACKEND=x11 when not already specified by the user, safely utilizing XWayland to bypass the Wayland display protocol crash.
    • Sets WEBKIT_DISABLE_DMABUF_RENDERER=1 when unset, preventing WebKitGTK DMA-BUF synchronization crashes and blank screen issues.
    • Conditionally compiled with #[cfg(target_os = "linux")] to ensure zero impact on macOS and Windows builds.

Verification

  • Verified on a fresh Fedora installation: application launches and runs stably with GDK_BACKEND=x11.
  • All 40 unit and integration tests passing (cargo test).
  • Rust workspace checks and formatting passing (cargo check, cargo fmt --all).

@EduTiyo EduTiyo self-assigned this Sep 23, 2026
@EduTiyo
EduTiyo merged commit 2807f9b into main Sep 23, 2026
1 check passed
@EduTiyo
EduTiyo deleted the fix/linux-wayland-crash branch September 23, 2026 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant