fix(cef): import gtk prelude for Linux dialog (TAURI-RUST-F)#18
Merged
M3gA-Mind merged 2 commits intoJun 5, 2026
Merged
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughWraps macOS NSAlert usage in an explicit ChangesPlatform-specific UI fixes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
12 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two compile fixes for breakage introduced by #17's merged code (commit
8ea806e): a Linux-onlygtktrait-import error and a macOS-onlyunsafe-call error. Both live incrates/tauri-runtime-cef/src/cef_init_guard.rs.Problem
#17 added a graceful CEF-init failure dialog with per-platform native implementations. Two of those paths fail to compile:
Linux — the
gtk_implpath callsdialog.set_title(...)anddialog.run()on agtk::MessageDialog, but the module never brings the gtk extension traits into scope.set_titleisGtkWindowExt::set_titleandrunisDialogExt::run— without those traits in scope the Linux target fails:It was caught by the downstream
cargo-llvm-covLinux coverage job.macOS — the
macospath calls four objc2NSAlertmethods (NSAlert::new,setMessageText,setInformativeText,runModal) that are markedunsafeinobjc2-app-kit, but invokes them outside anyunsafe {}block, socargo check -p tauri-runtime-ceffails on macOS:Both breaks are pre-existing in #17, not introduced by this PR — this PR fixes them.
Solution
use gtk::prelude::{DialogExt, GtkWindowExt};inside thegtk_implmodule — the two traits that providerunandset_title.NSAlertcalls in a single enclosingunsafe {}block with a// SAFETY:note (fresh receiver, valid strings, main thread guaranteed by theMainThreadMarker). No suppression attributes.Surgical, single-file changes; no behavior change on any platform.
Impact
gtktrait imports).cargo check -p tauri-runtime-cefpasses clean; fourE0133gone, no new warnings).Related
unsafe-call (E0133) regression from fix(tauri-runtime-cef): exit cleanly instead of panic when cef::initialize fails (TAURI-RUST-F) #17.tauri-cefsubmodule pin to this commit once merged.Summary by CodeRabbit