From c3fc3fb68ae592ffee82d41aabfe003c3bbc1758 Mon Sep 17 00:00:00 2001 From: Carlos Simon <1550281+Charlisim@users.noreply.github.com> Date: Thu, 13 Aug 2026 19:41:50 -0600 Subject: [PATCH] Fix Wayland crash on Nvidia by disabling explicit sync (#474) Co-authored-by: Claude Sonnet 4.6 --- crates-tauri/yaak-app-client/src/main.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/crates-tauri/yaak-app-client/src/main.rs b/crates-tauri/yaak-app-client/src/main.rs index 3e677761..393b8245 100644 --- a/crates-tauri/yaak-app-client/src/main.rs +++ b/crates-tauri/yaak-app-client/src/main.rs @@ -1,5 +1,17 @@ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] fn main() { + // On Nvidia + Wayland, WebKit2GTK's DMA-BUF renderer triggers a protocol error (71) due to + // an explicit sync bug (https://bugs.webkit.org/show_bug.cgi?id=280210). Disabling explicit + // sync via the Nvidia driver avoids the crash without disabling hardware acceleration. + #[cfg(target_os = "linux")] + if std::env::var("__NV_DISABLE_EXPLICIT_SYNC").is_err() + && std::env::var("WAYLAND_DISPLAY").is_ok() + && std::path::Path::new("/sys/module/nvidia").exists() + { + // SAFETY: called before any threads are spawned. + unsafe { std::env::set_var("__NV_DISABLE_EXPLICIT_SYNC", "1") }; + } + tauri_app_client_lib::run(); }