diff --git a/.changes/fix-resize-with-devtools.md b/.changes/fix-resize-with-devtools.md new file mode 100644 index 000000000000..f0ce41ef9890 --- /dev/null +++ b/.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. diff --git a/core/tauri-runtime-wry/src/lib.rs b/core/tauri-runtime-wry/src/lib.rs index 58b0729db3a1..006236143a8e 100644 --- a/core/tauri-runtime-wry/src/lib.rs +++ b/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( #[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();