Skip to content

Commit

Permalink
chore: target os import
Browse files Browse the repository at this point in the history
  • Loading branch information
pewsheen committed Jul 10, 2024
1 parent 2fb6be9 commit 17287ab
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
7 changes: 4 additions & 3 deletions examples/reparent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT

use objc2::rc::Retained;
use objc2_app_kit::NSWindow;
use tao::{
event::{ElementState, Event, KeyEvent, WindowEvent},
event_loop::{ControlFlow, EventLoop},
Expand All @@ -13,7 +11,10 @@ use tao::{
use wry::WebViewBuilder;

#[cfg(target_os = "macos")]
use {tao::platform::macos::WindowExtMacOS, wry::WebViewExtMacOS};
use {
objc2::rc::Retained, objc2_app_kit::NSWindow, tao::platform::macos::WindowExtMacOS,
wry::WebViewExtMacOS,
};
#[cfg(target_os = "windows")]
use {tao::platform::windows::WindowExtWindows, wry::WebViewExtWindows};

Expand Down
9 changes: 6 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,15 +222,18 @@ use android::*;

#[cfg(gtk)]
pub(crate) mod webkitgtk;
use objc2::rc::Retained;
use objc2_app_kit::NSWindow;
use objc2_web_kit::WKUserContentController;
/// Re-exported [raw-window-handle](https://docs.rs/raw-window-handle/latest/raw_window_handle/) crate.
pub use raw_window_handle;
use raw_window_handle::HasWindowHandle;
#[cfg(gtk)]
use webkitgtk::*;

#[cfg(any(target_os = "macos", target_os = "ios"))]
use objc2::rc::Retained;
#[cfg(any(target_os = "macos", target_os = "ios"))]
use objc2_app_kit::NSWindow;
#[cfg(any(target_os = "macos", target_os = "ios"))]
use objc2_web_kit::WKUserContentController;
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) mod wkwebview;
#[cfg(any(target_os = "macos", target_os = "ios"))]
Expand Down
3 changes: 2 additions & 1 deletion src/wkwebview/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ impl InnerWebView {
) {
unsafe {
#[cfg(feature = "tracing")]
tracing::info_span!(parent: None, "wry::custom_protocol::handle", uri = tracing::field::Empty).entered();
let span = tracing::info_span!(parent: None, "wry::custom_protocol::handle", uri = tracing::field::Empty)
.entered();

let task_key = (*task).hash(); // hash by task object address
let task_uuid = (*webview).add_custom_task_key(task_key);
Expand Down

0 comments on commit 17287ab

Please sign in to comment.