Skip to content

Commit

Permalink
fix linux detection
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog committed Apr 14, 2024
1 parent 8380d3c commit 68bcb1f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
);
}

Expand Down
4 changes: 4 additions & 0 deletions src/wkwebview/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ impl InnerWebView {
pl_attrs: super::PlatformSpecificWebViewAttributes,
_web_context: Option<&mut WebContext>,
) -> Result<Self> {
println!("N");
let ns_view = match window.window_handle()?.as_raw() {
#[cfg(target_os = "macos")]
RawWindowHandle::AppKit(w) => w.ns_view.as_ptr(),
Expand Down Expand Up @@ -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(())
Expand Down

0 comments on commit 68bcb1f

Please sign in to comment.