Эх сурвалжийг харах

fix(wry): resize webview on window move, closes #1911 (#2135)

Lucas Fernandes Nogueira 4 жил өмнө
parent
commit
06abe65569

+ 5 - 0
.changes/fix-webview-resize-on-move.md

@@ -0,0 +1,5 @@
+---
+"tauri-runtime-wry": patch
+---
+
+Applies a workaround to a Windows webview2 positioning issue after a window move event.

+ 2 - 1
core/tauri-runtime-wry/src/lib.rs

@@ -1539,7 +1539,8 @@ fn handle_event_loop(
             menu_event_listeners.clone(),
           );
         }
-        WryWindowEvent::Resized(_) => {
+        // we also resize the webview on `Moved` to fix https://github.com/tauri-apps/tauri/issues/1911
+        WryWindowEvent::Resized(_) | WryWindowEvent::Moved(_) => {
           if let Err(e) = webviews[&window_id].inner.resize() {
             eprintln!("{}", e);
           }