mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-08-17 03:40:23 +03:00
fix(tauri-runtime-wry): Window::inner_size crash when the window has no webviews (#9428)
This commit is contained in:
parent
c8a82ad223
commit
02eaf07872
5
.changes/fix-window-inner-size-crash.md
Normal file
5
.changes/fix-window-inner-size-crash.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"tauri-runtime-wry": patch:bug
|
||||||
|
---
|
||||||
|
|
||||||
|
Fixes `inner_size` crash when the window has no webviews.
|
@ -4082,7 +4082,7 @@ fn inner_size(
|
|||||||
webviews: &[WebviewWrapper],
|
webviews: &[WebviewWrapper],
|
||||||
has_children: bool,
|
has_children: bool,
|
||||||
) -> TaoPhysicalSize<u32> {
|
) -> TaoPhysicalSize<u32> {
|
||||||
if !has_children {
|
if !has_children && webviews.len() > 0 {
|
||||||
use wry::WebViewExtMacOS;
|
use wry::WebViewExtMacOS;
|
||||||
let webview = webviews.first().unwrap();
|
let webview = webviews.first().unwrap();
|
||||||
let view_frame = unsafe { cocoa::appkit::NSView::frame(webview.webview()) };
|
let view_frame = unsafe { cocoa::appkit::NSView::frame(webview.webview()) };
|
||||||
|
Loading…
Reference in New Issue
Block a user