mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-03 10:11:15 +02:00
Co-authored-by: Lucas Nogueira <lucas@tauri.studio> fix(windows): respect `focused: false` for webview, closes #7519
This commit is contained in:
6
.changes/tauri-focused-windows.md
Normal file
6
.changes/tauri-focused-windows.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
'tauri': 'patch:bug'
|
||||
'tauri-runtime-wry': 'patch:bug'
|
||||
---
|
||||
|
||||
Properly respect the `focused` option when creating the webview.
|
||||
@@ -13,7 +13,7 @@ exclude = [ "CHANGELOG.md", "/target" ]
|
||||
readme = "README.md"
|
||||
|
||||
[dependencies]
|
||||
wry = { version = "0.24.1", default-features = false, features = [ "file-drop", "protocol" ] }
|
||||
wry = { version = "0.24.4", default-features = false, features = [ "file-drop", "protocol" ] }
|
||||
tauri-runtime = { version = "0.14.0", path = "../tauri-runtime" }
|
||||
tauri-utils = { version = "1.4.0", path = "../tauri-utils" }
|
||||
uuid = { version = "1", features = [ "v4" ] }
|
||||
|
||||
@@ -3154,6 +3154,7 @@ fn create_webview<T: UserEvent>(
|
||||
} else {
|
||||
None
|
||||
};
|
||||
let focused = window_builder.inner.window.focused;
|
||||
let window = window_builder.inner.build(event_loop).unwrap();
|
||||
|
||||
webview_id_map.insert(window.id(), window_id);
|
||||
@@ -3163,6 +3164,7 @@ fn create_webview<T: UserEvent>(
|
||||
}
|
||||
let mut webview_builder = WebViewBuilder::new(window)
|
||||
.map_err(|e| Error::CreateWebview(Box::new(e)))?
|
||||
.with_focused(focused)
|
||||
.with_url(&url)
|
||||
.unwrap() // safe to unwrap because we validate the URL beforehand
|
||||
.with_transparent(is_window_transparent)
|
||||
|
||||
4
examples/api/src-tauri/Cargo.lock
generated
4
examples/api/src-tauri/Cargo.lock
generated
@@ -4734,9 +4734,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wry"
|
||||
version = "0.24.3"
|
||||
version = "0.24.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "33748f35413c8a98d45f7a08832d848c0c5915501803d1faade5a4ebcd258cea"
|
||||
checksum = "88ef04bdad49eba2e01f06e53688c8413bd6a87b0bc14b72284465cf96e3578e"
|
||||
dependencies = [
|
||||
"base64 0.13.1",
|
||||
"block",
|
||||
|
||||
Reference in New Issue
Block a user