Bladeren bron

fix: rendering issue when resizing with devtools open closes #3914 #3814 (#3915)

Lucas Fernandes Nogueira 3 jaren geleden
bovenliggende
commit
80b714af6b
2 gewijzigde bestanden met toevoegingen van 13 en 2 verwijderingen
  1. 6 0
      .changes/fix-resize-with-devtools.md
  2. 7 2
      core/tauri-runtime-wry/src/lib.rs

+ 6 - 0
.changes/fix-resize-with-devtools.md

@@ -0,0 +1,6 @@
+---
+"tauri-runtime-wry": patch
+"tauri": patch
+---
+
+Fixes a rendering issue when resizing the window with the devtools open.

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

@@ -28,6 +28,8 @@ use tauri_runtime::{SystemTray, SystemTrayEvent};
 use webview2_com::FocusChangedEventHandler;
 #[cfg(windows)]
 use windows::Win32::{Foundation::HWND, System::WinRT::EventRegistrationToken};
+#[cfg(target_os = "macos")]
+use wry::application::platform::macos::WindowBuilderExtMacOS;
 #[cfg(all(feature = "system-tray", target_os = "macos"))]
 use wry::application::platform::macos::{SystemTrayBuilderExtMacOS, SystemTrayExtMacOS};
 #[cfg(target_os = "linux")]
@@ -906,8 +908,6 @@ impl WindowBuilder for WindowBuilderWrapper {
 
   #[cfg(target_os = "macos")]
   fn parent_window(mut self, parent: *mut std::ffi::c_void) -> Self {
-    use wry::application::platform::macos::WindowBuilderExtMacOS;
-
     self.inner = self.inner.with_parent_window(parent);
     self
   }
@@ -2687,6 +2687,11 @@ fn create_webview<T: UserEvent>(
   #[cfg(windows)]
   let proxy = context.proxy.clone();
 
+  #[cfg(target_os = "macos")]
+  {
+    window_builder.inner = window_builder.inner.with_fullsize_content_view(true);
+  }
+
   let is_window_transparent = window_builder.inner.window.transparent;
   let menu_items = if let Some(menu) = window_builder.menu {
     let mut menu_items = HashMap::new();