fix(core): window transparency (#1800)

This commit is contained in:
Lucas Fernandes Nogueira 2021-05-12 10:55:12 -03:00 committed by GitHub
parent cd638cbf5b
commit f5a480fea3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
"tauri-runtime-wry": patch
---
Fixes webview transparency.

View File

@ -1071,11 +1071,13 @@ fn create_webview<P: Params<Runtime = Wry>>(
..
} = pending;
let is_window_transparent = window_builder.0.window.transparent;
let window = window_builder.0.build(event_loop).unwrap();
let mut webview_builder = WebViewBuilder::new(window)
.map_err(|e| Error::CreateWebview(Box::new(e)))?
.with_url(&url)
.unwrap(); // safe to unwrap because we validate the URL beforehand
.unwrap() // safe to unwrap because we validate the URL beforehand
.with_transparent(is_window_transparent);
if let Some(handler) = rpc_handler {
webview_builder =
webview_builder.with_rpc_handler(create_rpc_handler(context.clone(), label.clone(), handler));