From b630dc36634a35d24e4a909bad8bcf1ea51668bd Mon Sep 17 00:00:00 2001 From: rhysd Date: Thu, 9 Nov 2023 23:50:00 +0900 Subject: [PATCH] fix(unix): fix feature gate on `WebviewExtUnix` Signed-off-by: rhysd --- src/lib.rs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 98dc32c5c..1461a4861 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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()