From 15310439438210324129de24f440f3ea0527d933 Mon Sep 17 00:00:00 2001 From: David Lemarier Date: Sun, 25 Apr 2021 08:19:45 -0400 Subject: [PATCH] fix(webview): `setWantsLayer` is not available on iOS --- src/webview/mod.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/webview/mod.rs b/src/webview/mod.rs index 45e5e3c..ac67703 100644 --- a/src/webview/mod.rs +++ b/src/webview/mod.rs @@ -71,7 +71,10 @@ fn allocate_webview( let zero: CGRect = Rect::zero().into(); let webview_alloc: id = msg_send![register_webview_class(), alloc]; let webview: id = msg_send![webview_alloc, initWithFrame:zero configuration:configuration]; + + #[cfg(target_os = "macos")] let _: () = msg_send![webview, setWantsLayer:YES]; + let _: () = msg_send![webview, setTranslatesAutoresizingMaskIntoConstraints:NO]; if let Some(delegate) = &objc_delegate {