fix(tauri): correct Linux CEF startup (#1185)

<!-- Please read
https://github.com/SableClient/Sable/blob/dev/CONTRIBUTING.md before
submitting your pull request -->

### Description

<!-- Please include a summary of the change. Please also include
relevant motivation and context. List any dependencies that are required
for this change. -->

Fixes #

#### Type of change

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update

### Checklist:

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings

### AI disclosure:

- [ ] Partially AI assisted (clarify which code was AI assisted and
briefly explain what it does).
- [ ] Fully AI generated (explain what all the generated code does in
moderate detail).
<!-- Write any explanation required here, but do not generate the
explanation using AI!! You must prove you understand what the code in
this PR does. -->
This commit is contained in:
7w1 authored and GitHub committed 2026-07-21 21:30:19 +00:00
commit fb47a3966f
2 files changed
+11 -12

No files matched your search

+5
View File
@@ -280,6 +280,11 @@ pub fn run() {
network::media_protocol::respond,
)
.setup(|app| {
// CEF is initialized during runtime construction; initialize GTK afterward
// on the main thread for the Linux tray menu.
#[cfg(all(feature = "cef", target_os = "linux"))]
gtk::init()?;
network::native_upload::cleanup_uploads(app.handle());
#[cfg(any(target_os = "linux", all(debug_assertions, windows)))]
+6 -12
View File
@@ -16,14 +16,14 @@ fn main() {
],
deep_link_schemes: vec!["moe.sable.app".into(), "sable".into()],
command_line_args: vec![
("disable-gpu-sandbox".into(), None),
("disable-font-subpixel-positioning".into(), None),
("enable-font-antialiasing".into(), None),
("--disable-gpu-sandbox".into(), None),
("--disable-font-subpixel-positioning".into(), None),
("--enable-font-antialiasing".into(), None),
("autoplay-policy".into(), Some("no-user-gesture-required".into())),
("enable-features".into(), Some("SharedArrayBuffer".into())),
("disable-background-timer-throttling".into(), None),
("disable-renderer-backgrounding".into(), None),
("disable-backgrounding-occluded-windows".into(), None),
("--disable-background-timer-throttling".into(), None),
("--disable-renderer-backgrounding".into(), None),
("--disable-backgrounding-occluded-windows".into(), None),
("disable-features".into(), Some(
"SpareRendererForSitePerProcess,IntensiveWakeUpThrottling,CalculateNativeWinOcclusion,AutofillActorMode,GlicActorUi,LensOverlay".into()
)),
@@ -148,12 +148,6 @@ fn main() {
}
}
// CEF doesn't init GTK, but the Linux tray menu needs it.
#[cfg(all(feature = "cef", target_os = "linux"))]
{
let _ = gtk::init();
}
// Deep-link primary: hold the forwarding socket for the process lifetime.
#[cfg(all(feature = "cef", target_os = "linux"))]
let _deep_link_guard = app_lib::deep_link_ipc::bind_and_listen();