From 6d31706a6bff43e9b28100675cf8fc12f29db248 Mon Sep 17 00:00:00 2001 From: "Ngo Iok Ui (Wu Yu Wei)" Date: Wed, 24 Mar 2021 21:19:27 +0800 Subject: [PATCH] Fix visibility on webview2 when window was invisible previously (#128) * Fix visibility on webview2 when window was invisible previously We set webview2 to be always visible for simplicity. This is more of a workaround. Microsoft is also working to fix it: https://github.com/MicrosoftEdge/WebView2Feedback/issues/1077 * Add changes file --- .changes/visible.md | 6 ++++++ src/webview/win/mod.rs | 1 + 2 files changed, 7 insertions(+) create mode 100644 .changes/visible.md diff --git a/.changes/visible.md b/.changes/visible.md new file mode 100644 index 000000000..2f4a422b4 --- /dev/null +++ b/.changes/visible.md @@ -0,0 +1,6 @@ +--- +"wry": patch +--- + +Fix visibility on webview2 when window was invisible previously and then shown. + diff --git a/src/webview/win/mod.rs b/src/webview/win/mod.rs index c230ef3a6..7577490c2 100644 --- a/src/webview/win/mod.rs +++ b/src/webview/win/mod.rs @@ -180,6 +180,7 @@ impl WV for InnerWebView { } } + controller.put_is_visible(true); let _ = controller_clone.set(controller); if let Some(file_drop_handler) = file_drop_handler {