Skip to content

Commit

Permalink
fix(unix): fix feature gate on WebviewExtUnix (#1068)
Browse files Browse the repository at this point in the history
Signed-off-by: rhysd <lin90162@yahoo.co.jp>
  • Loading branch information
rhysd authored Nov 11, 2023
1 parent e5c496e commit 587d4a4
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1454,14 +1454,26 @@ impl WebviewExtWindows for WebView {
}
}

/// Additional methods on `WebView` that are specific to Linux.
#[cfg(target_os = "linux")]
/// Additional methods on `WebView` that are specific to Unix.
#[cfg(any(
target_os = "linux",
target_os = "dragonfly",
target_os = "freebsd",
target_os = "netbsd",
target_os = "openbsd",
))]
pub trait WebviewExtUnix {
/// Returns Webkit2gtk Webview handle
fn webview(&self) -> webkit2gtk::WebView;
}

#[cfg(target_os = "linux")]
#[cfg(any(
target_os = "linux",
target_os = "dragonfly",
target_os = "freebsd",
target_os = "netbsd",
target_os = "openbsd",
))]
impl WebviewExtUnix for WebView {
fn webview(&self) -> webkit2gtk::WebView {
self.webview.webview.clone()
Expand Down

0 comments on commit 587d4a4

Please sign in to comment.