Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ webkit2gtk = { version = "2.0", optional = true, features = ["v2_34"] }
# Fork of tauri's unreleased feat/cef branch, ported onto published crates.
# https://github.com/SableClient/tauri-runtime-cef
[target.'cfg(target_os = "linux")'.dependencies]
tauri-runtime-cef = { git = "https://github.com/SableClient/tauri-runtime-cef", rev = "69a6b8cac865f48bfaf324c21369a2bd101c1e94", optional = true }
tauri-runtime-cef = { git = "https://github.com/SableClient/tauri-runtime-cef", rev = "eace83edf055acc17e811b2bc75d4b6eadf39670", optional = true }
cef = { version = "=150.2.1", optional = true }
libloading = "0.9"
zbus = "5"
Expand Down
18 changes: 17 additions & 1 deletion src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ fn prompt_cef_permission(message: String, tx: std::sync::mpsc::Sender<bool>) {
});
}

#[cfg(target_os = "linux")]
fn is_cef_views() -> bool {
cfg!(feature = "cef")
&& std::env::var_os("SABLE_CEF_VIEWS").is_some()
// Only supported on Wayland for now
&& std::env::var_os("WAYLAND_DISPLAY").is_some()
}

fn main() {
// CEF (Chromium) runtime, Linux only. Must run before anything else — CEF
// re-execs this binary for its subprocesses.
Expand Down Expand Up @@ -96,6 +104,11 @@ fn main() {
}
args
},
linux_windowing: if is_cef_views() {
tauri_runtime_cef::LinuxWindowing::Wayland
} else {
tauri_runtime_cef::LinuxWindowing::X11
},
..Default::default()
});

Expand Down Expand Up @@ -220,7 +233,10 @@ fn main() {
// 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");
// Dont' force X11 if explictly opted into CEF Views runtime
if !is_cef_views() {
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
Expand Down
Loading