added web context back and updated wry to latest

This commit is contained in:
Andrew Collins committed 2023-04-05 22:09:17 -04:00
1 parent 61d100e1f8
commit 073c4140d9
5 files changed
+23 -18

No files matched your search

+4 -2
View File
@@ -36,8 +36,8 @@ use tao::{
};
pub use wry;
pub use wry::application as tao;
use wry::application::window::WindowId;
use wry::webview::WebView;
use wry::{application::window::WindowId, webview::WebContext};
/// Launch the WebView and run the event loop.
///
@@ -281,7 +281,7 @@ fn create_new_window(
event_handlers: &WindowEventHandlers,
shortcut_manager: ShortcutRegistry,
) -> WebviewHandler {
let webview = webview::build(&mut cfg, event_loop, proxy.clone());
let (webview, web_context) = webview::build(&mut cfg, event_loop, proxy.clone());
dom.base_scope().provide_context(DesktopContext::new(
webview.clone(),
@@ -299,6 +299,7 @@ fn create_new_window(
webview,
dom,
waker: waker::tao_waker(proxy, id),
web_context,
}
}
@@ -306,6 +307,7 @@ struct WebviewHandler {
dom: VirtualDom,
webview: Rc<wry::webview::WebView>,
waker: Waker,
web_context: WebContext,
}
/// Poll the virtualdom until it's pending