Merge branch 'upstream' into disable-browser-shortcuts
This commit is contained in:
commit
bc014f7107
7 files changed
+113
-12
No files matched your search
@@ -7,13 +7,13 @@ use tao::event_loop::{EventLoopProxy, EventLoopWindowTarget};
|
||||
pub use wry;
|
||||
pub use wry::application as tao;
|
||||
use wry::application::window::Window;
|
||||
use wry::webview::{WebView, WebViewBuilder};
|
||||
use wry::webview::{WebContext, WebView, WebViewBuilder};
|
||||
|
||||
pub fn build(
|
||||
cfg: &mut Config,
|
||||
event_loop: &EventLoopWindowTarget<UserWindowEvent>,
|
||||
proxy: EventLoopProxy<UserWindowEvent>,
|
||||
) -> Rc<WebView> {
|
||||
) -> (Rc<WebView>, WebContext) {
|
||||
let builder = cfg.window.clone();
|
||||
let window = builder.build(event_loop).unwrap();
|
||||
let file_handler = cfg.file_drop_handler.take();
|
||||
@@ -33,6 +33,8 @@ pub fn build(
|
||||
));
|
||||
}
|
||||
|
||||
let mut web_context = WebContext::new(cfg.data_dir.clone());
|
||||
|
||||
let mut webview = WebViewBuilder::new(window)
|
||||
.unwrap()
|
||||
.with_transparent(cfg.window.window.transparent)
|
||||
@@ -52,7 +54,8 @@ pub fn build(
|
||||
.as_ref()
|
||||
.map(|handler| handler(window, evet))
|
||||
.unwrap_or_default()
|
||||
});
|
||||
})
|
||||
.with_web_context(&mut web_context);
|
||||
|
||||
#[cfg(windows)]
|
||||
{
|
||||
@@ -89,5 +92,5 @@ pub fn build(
|
||||
webview = webview.with_devtools(true);
|
||||
}
|
||||
|
||||
Rc::new(webview.build().unwrap())
|
||||
(Rc::new(webview.build().unwrap()), web_context)
|
||||
}
|
||||
Reference in new issue
Block a user