From 94dbc96c97eb490b4d08aa04c3db69b907535b68 Mon Sep 17 00:00:00 2001 From: "Ngo Iok Ui (Wu Yu Wei)" Date: Sun, 20 Jun 2021 20:37:26 +0800 Subject: [PATCH] fix(dialog): modal stuck on Linux (#2012) Co-authored-by: Lucas Nogueira --- core/tauri/src/endpoints.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/core/tauri/src/endpoints.rs b/core/tauri/src/endpoints.rs index 4feebad1e..3a4d55531 100644 --- a/core/tauri/src/endpoints.rs +++ b/core/tauri/src/endpoints.rs @@ -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) => {