From f5d5d82084c2fc900cde4a4a91b0eb85d1e60f0b Mon Sep 17 00:00:00 2001 From: Carlos Simon Date: Tue, 16 Jun 2026 08:27:49 -0600 Subject: [PATCH 1/2] fix(linux): disable WebKit DMA-BUF renderer to prevent Wayland protocol error WebKit2GTK's DMA-BUF renderer causes a protocol error (71) on some Wayland compositors (e.g. Hyprland), crashing the app on startup. Fall back to SHM rendering by default; users can opt back in by setting the variable themselves. Co-Authored-By: Claude Sonnet 4.6 --- crates-tauri/yaak-app-client/src/main.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates-tauri/yaak-app-client/src/main.rs b/crates-tauri/yaak-app-client/src/main.rs index 3e6777617..8c76d733e 100644 --- a/crates-tauri/yaak-app-client/src/main.rs +++ b/crates-tauri/yaak-app-client/src/main.rs @@ -1,5 +1,12 @@ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] fn main() { + // Prevents a Wayland protocol error (71) in WebKit2GTK's DMA-BUF renderer on some compositors. + #[cfg(target_os = "linux")] + if std::env::var("WEBKIT_DISABLE_DMABUF_RENDERER").is_err() { + // SAFETY: called before any threads are spawned. + unsafe { std::env::set_var("WEBKIT_DISABLE_DMABUF_RENDERER", "1") }; + } + tauri_app_client_lib::run(); } From 5bbaaaa2c1d9b74e87621373701088d3739ee4b4 Mon Sep 17 00:00:00 2001 From: Carlos Simon Date: Wed, 17 Jun 2026 05:31:03 -0600 Subject: [PATCH 2/2] fix(linux): disable Nvidia explicit sync on Wayland to prevent WebKit crash The DMA-BUF renderer in WebKit2GTK triggers a Wayland protocol error (71) on Nvidia GPUs due to an explicit sync conflict (WebKit bug #280210). Setting __NV_DISABLE_EXPLICIT_SYNC=1 targets only affected systems (Nvidia drivers + Wayland) and avoids disabling hardware acceleration. Co-Authored-By: Claude Sonnet 4.6 --- crates-tauri/yaak-app-client/src/main.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/crates-tauri/yaak-app-client/src/main.rs b/crates-tauri/yaak-app-client/src/main.rs index 8c76d733e..393b82459 100644 --- a/crates-tauri/yaak-app-client/src/main.rs +++ b/crates-tauri/yaak-app-client/src/main.rs @@ -1,11 +1,16 @@ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] fn main() { - // Prevents a Wayland protocol error (71) in WebKit2GTK's DMA-BUF renderer on some compositors. + // 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("WEBKIT_DISABLE_DMABUF_RENDERER").is_err() { + 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("WEBKIT_DISABLE_DMABUF_RENDERER", "1") }; + unsafe { std::env::set_var("__NV_DISABLE_EXPLICIT_SYNC", "1") }; } tauri_app_client_lib::run();