mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-10-05 20:48:58 +03:00
* fix(tauri-runtime-wry): window inner size regression on macOS, closes #9236 * lint
This commit is contained in:
parent
7898b601d1
commit
e7cd973123
5
.changes/fix-inner-size.md
Normal file
5
.changes/fix-inner-size.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri-runtime-wry": patch:bug
|
||||
---
|
||||
|
||||
Fix window inner size evaluation on macOS.
|
@ -436,14 +436,12 @@ impl WindowEventWrapper {
|
||||
// because wry replaces the NSView
|
||||
TaoWindowEvent::Resized(_) => {
|
||||
if let Some(w) = &window.inner {
|
||||
Self(Some(WindowEvent::Resized(
|
||||
PhysicalSizeWrapper(inner_size(
|
||||
w,
|
||||
&window.webviews,
|
||||
window.has_children.load(Ordering::Relaxed),
|
||||
))
|
||||
.into(),
|
||||
)))
|
||||
let size = inner_size(
|
||||
w,
|
||||
&window.webviews,
|
||||
window.has_children.load(Ordering::Relaxed),
|
||||
);
|
||||
Self(Some(WindowEvent::Resized(PhysicalSizeWrapper(size).into())))
|
||||
} else {
|
||||
Self(None)
|
||||
}
|
||||
@ -3915,7 +3913,7 @@ fn inner_size(
|
||||
webviews: &[WebviewWrapper],
|
||||
has_children: bool,
|
||||
) -> TaoPhysicalSize<u32> {
|
||||
if has_children && webviews.len() == 1 {
|
||||
if !has_children {
|
||||
use wry::WebViewExtMacOS;
|
||||
let webview = webviews.first().unwrap();
|
||||
let view_frame = unsafe { cocoa::appkit::NSView::frame(webview.webview()) };
|
||||
|
@ -41,6 +41,8 @@ impl StartingBinary {
|
||||
///
|
||||
/// Because [`Error`] is not clone-able, it is recreated instead.
|
||||
pub(super) fn cloned(&self) -> Result<PathBuf> {
|
||||
// false positive
|
||||
#[allow(clippy::useless_asref)]
|
||||
self
|
||||
.0
|
||||
.as_ref()
|
||||
|
@ -127,7 +127,7 @@ impl ResourceTable {
|
||||
.index
|
||||
.get(&rid)
|
||||
.and_then(|rc| rc.downcast_arc::<T>())
|
||||
.map(Clone::clone)
|
||||
.cloned()
|
||||
.ok_or_else(|| Error::BadResourceId(rid))
|
||||
}
|
||||
|
||||
@ -137,7 +137,7 @@ impl ResourceTable {
|
||||
self
|
||||
.index
|
||||
.get(&rid)
|
||||
.map(Clone::clone)
|
||||
.cloned()
|
||||
.ok_or_else(|| Error::BadResourceId(rid))
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user