diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 69c3a72ec..d42d2ed28 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -2,5 +2,21 @@ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] fn main() { + #[cfg(target_os = "linux")] + unsafe { + // Tao/Tauri Wayland decorations are don't respect server side decorations, forcing GTK onto X11/XWayland for now. + // https://github.com/tauri-apps/tao/issues/1046 + // https://github.com/tauri-apps/tauri/issues/11856 + // https://github.com/tauri-apps/tauri/issues/14251 + std::env::set_var("GDK_BACKEND", "x11"); + + // NVIDIA explicit sync is another upstream WebKitGTK/Wayland failure mode. Prefer this lower-cost workaround over WEBKIT_DISABLE_DMABUF_RENDERER=1, but don't stomp an explicit user override. + // https://github.com/tauri-apps/tauri/issues/10702 + // https://github.com/tauri-apps/tauri/issues/9394 + if std::env::var_os("__NV_DISABLE_EXPLICIT_SYNC").is_none() { + std::env::set_var("__NV_DISABLE_EXPLICIT_SYNC", "1"); + } + } + app_lib::run(); } diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index fbeb283d6..1b6314f72 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -18,6 +18,14 @@ "bundle": { "active": true, "targets": "all", + "linux": { + "deb": { + "depends": ["xwayland"] + }, + "rpm": { + "depends": ["xorg-x11-server-Xwayland"] + } + }, "icon": [ "icons/32x32.png", "icons/128x128.png", @@ -45,4 +53,4 @@ ] } } -} \ No newline at end of file +}