From 628f6bc0757f8a355d0160816b4ea742fed05e5f Mon Sep 17 00:00:00 2001 From: Amr Bashir Date: Thu, 31 Aug 2023 01:25:29 +0300 Subject: [PATCH 1/3] fix(windows): respect `focused: false` for webview, closes #7519 --- .changes/tauri-focused-windows.md | 6 ++++++ core/tauri-runtime-wry/Cargo.toml | 2 +- core/tauri-runtime-wry/src/lib.rs | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 .changes/tauri-focused-windows.md diff --git a/.changes/tauri-focused-windows.md b/.changes/tauri-focused-windows.md new file mode 100644 index 00000000000..4a2cd821923 --- /dev/null +++ b/.changes/tauri-focused-windows.md @@ -0,0 +1,6 @@ +--- +'tauri': 'patch:bug' +'tauri-runtime-wry': 'patch:bug' +--- + +On Windows, properly respect `focused: false` when creating the window. diff --git a/core/tauri-runtime-wry/Cargo.toml b/core/tauri-runtime-wry/Cargo.toml index 843a95ff379..c4a31a340e5 100644 --- a/core/tauri-runtime-wry/Cargo.toml +++ b/core/tauri-runtime-wry/Cargo.toml @@ -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 = { git = "https://github.com/tauri-apps/wry", branch = "v0.24.1", 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" ] } diff --git a/core/tauri-runtime-wry/src/lib.rs b/core/tauri-runtime-wry/src/lib.rs index e26f8f8f195..40aeb5b42d5 100644 --- a/core/tauri-runtime-wry/src/lib.rs +++ b/core/tauri-runtime-wry/src/lib.rs @@ -3153,6 +3153,7 @@ fn create_webview( } 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); @@ -3162,6 +3163,7 @@ fn create_webview( } 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) From 3f00e00ecd66732458a595e90758689a3b06ad90 Mon Sep 17 00:00:00 2001 From: Lucas Nogueira Date: Mon, 11 Sep 2023 15:36:12 -0300 Subject: [PATCH 2/3] update change file --- .changes/tauri-focused-windows.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changes/tauri-focused-windows.md b/.changes/tauri-focused-windows.md index 4a2cd821923..0bc7cc7b5fe 100644 --- a/.changes/tauri-focused-windows.md +++ b/.changes/tauri-focused-windows.md @@ -3,4 +3,4 @@ 'tauri-runtime-wry': 'patch:bug' --- -On Windows, properly respect `focused: false` when creating the window. +Properly respect the `focused` option when creating the webview. From b8ce5b59c9ec31152f745846f167523d2ef23c09 Mon Sep 17 00:00:00 2001 From: Lucas Nogueira Date: Mon, 11 Sep 2023 15:47:17 -0300 Subject: [PATCH 3/3] wry 0.24.4 --- core/tauri-runtime-wry/Cargo.toml | 2 +- examples/api/src-tauri/Cargo.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/tauri-runtime-wry/Cargo.toml b/core/tauri-runtime-wry/Cargo.toml index c4a31a340e5..30aa3b2a42d 100644 --- a/core/tauri-runtime-wry/Cargo.toml +++ b/core/tauri-runtime-wry/Cargo.toml @@ -13,7 +13,7 @@ exclude = [ "CHANGELOG.md", "/target" ] readme = "README.md" [dependencies] -wry = { git = "https://github.com/tauri-apps/wry", branch = "v0.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" ] } diff --git a/examples/api/src-tauri/Cargo.lock b/examples/api/src-tauri/Cargo.lock index c30d606b309..1d214dab15a 100644 --- a/examples/api/src-tauri/Cargo.lock +++ b/examples/api/src-tauri/Cargo.lock @@ -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",