mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-01 10:01:07 +02:00
fix(dialog): modal stuck on Linux (#2012)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
This commit is contained in:
committed by
GitHub
parent
5ca462f6cc
commit
94dbc96c97
@@ -113,17 +113,14 @@ impl Module {
|
||||
.and_then(|r| r.json)
|
||||
.map_err(InvokeError::from)
|
||||
}),
|
||||
// on Linux, the dialog must run on the main thread.
|
||||
// on Linux, the dialog must run on the rpc task.
|
||||
#[cfg(target_os = "linux")]
|
||||
Self::Dialog(cmd) => {
|
||||
let window_ = window.clone();
|
||||
let _ = window.run_on_main_thread(move || {
|
||||
resolver.respond_closure(move || {
|
||||
cmd
|
||||
.run(window_)
|
||||
.and_then(|r| r.json)
|
||||
.map_err(InvokeError::from)
|
||||
})
|
||||
resolver.respond_closure(move || {
|
||||
cmd
|
||||
.run(window)
|
||||
.and_then(|r| r.json)
|
||||
.map_err(InvokeError::from)
|
||||
});
|
||||
}
|
||||
Self::Cli(cmd) => {
|
||||
|
||||
Reference in New Issue
Block a user