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
5 changes: 5 additions & 0 deletions .changes/fix-set-window-effects-main-thread.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tauri": "patch:bug"
---

Fixed set_window_effects not runs on main thread in WindowBuilder.
8 changes: 4 additions & 4 deletions crates/tauri/src/window/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -406,14 +406,14 @@ tauri::Builder::default()
window.on_menu_event(handler);
}

if let Some(effects) = self.window_effects {
crate::vibrancy::set_window_effects(&window, Some(effects))?;
}

let app_manager = self.manager.manager_owned();
let window_label = window.label().to_string();
let window_ = window.clone();
// run on the main thread to fix a deadlock on webview.eval if the tracing feature is enabled
let _ = window.run_on_main_thread(move || {
if let Some(effects) = self.window_effects {
_ = crate::vibrancy::set_window_effects(&window_, Some(effects));
}
let event = crate::EventName::from_str("tauri://window-created");
let payload = Some(crate::webview::CreatedEvent {
label: window_label,
Expand Down