From 68bcb1f8bbe5eed1a6978148228aa0a520929fc5 Mon Sep 17 00:00:00 2001 From: Lucas Nogueira Date: Sun, 14 Apr 2024 08:10:25 -0300 Subject: [PATCH] fix linux detection --- build.rs | 4 ++-- src/wkwebview/mod.rs | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/build.rs b/build.rs index 04f337727..6a4d464b6 100644 --- a/build.rs +++ b/build.rs @@ -107,11 +107,11 @@ fn main() { alias("ios", target.contains("ios")); alias("windows", target.contains("windows")); alias("apple", target.contains("apple")); - alias("linux", target.contains("linux")); + alias("linux", target.contains("unknown-linux")); alias( "gtk", - cfg!(feature = "os-webview") && target.contains("linux"), + cfg!(feature = "os-webview") && target.contains("unknown-linux"), ); } diff --git a/src/wkwebview/mod.rs b/src/wkwebview/mod.rs index b32833635..ee606e657 100644 --- a/src/wkwebview/mod.rs +++ b/src/wkwebview/mod.rs @@ -112,6 +112,7 @@ impl InnerWebView { pl_attrs: super::PlatformSpecificWebViewAttributes, _web_context: Option<&mut WebContext>, ) -> Result { + println!("N"); let ns_view = match window.window_handle()?.as_raw() { #[cfg(target_os = "macos")] RawWindowHandle::AppKit(w) => w.ns_view.as_ptr(), @@ -1203,8 +1204,11 @@ r#"Object.defineProperty(window, 'ipc', { #[cfg(target_os = "macos")] pub(crate) fn reparent(&self, window: id) -> crate::Result<()> { unsafe { + println!("A"); let content_view: id = msg_send![window, contentView]; + println!("AB"); let _: () = msg_send![content_view, addSubview: self.webview]; + println!("ABC"); } Ok(())