mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-12-15 05:31:42 +03:00
feat(core): create webview immediately when running in main thread (#3891)
This commit is contained in:
parent
82c7855bf8
commit
fa2baba76c
5
.changes/wry-create-webview.md
Normal file
5
.changes/wry-create-webview.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri-runtime-wry": patch
|
||||
---
|
||||
|
||||
Create webview immediately when executed in the main thread.
|
@ -202,15 +202,16 @@ impl<T: UserEvent> Context<T> {
|
||||
|
||||
self.prepare_window(window_id);
|
||||
|
||||
self
|
||||
.proxy
|
||||
.send_event(Message::CreateWebview(
|
||||
let context_ = context.clone();
|
||||
send_user_message(
|
||||
&context_,
|
||||
Message::CreateWebview(
|
||||
window_id,
|
||||
Box::new(move |event_loop, web_context| {
|
||||
create_webview(window_id, event_loop, web_context, context, pending)
|
||||
}),
|
||||
))
|
||||
.map_err(|_| Error::FailedToSendMessage)?;
|
||||
),
|
||||
)?;
|
||||
|
||||
let dispatcher = WryDispatcher {
|
||||
window_id,
|
||||
|
Loading…
Reference in New Issue
Block a user