From 8f00067266140f824b7bdabbdd3ec4d3c2b92b7a Mon Sep 17 00:00:00 2001 From: fufesou <13586388+fufesou@users.noreply.github.com> Date: Mon, 12 Aug 2024 22:15:59 +0800 Subject: [PATCH] fix: build (#9036) Signed-off-by: fufesou --- src/privacy_mode.rs | 11 +++-------- src/privacy_mode/win_exclude_from_capture.rs | 2 +- src/privacy_mode/win_mag.rs | 2 +- src/privacy_mode/win_virtual_display.rs | 2 +- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/privacy_mode.rs b/src/privacy_mode.rs index 8b1510625..a02b8bc93 100644 --- a/src/privacy_mode.rs +++ b/src/privacy_mode.rs @@ -38,14 +38,9 @@ pub const TURN_OFF_OTHER_ID: &'static str = "Failed to turn off privacy mode that belongs to someone else."; pub const NO_PHYSICAL_DISPLAYS: &'static str = "no_need_privacy_mode_no_physical_displays_tip"; -#[cfg(windows)] -pub const PRIVACY_MODE_IMPL_WIN_MAG: &str = win_mag::PRIVACY_MODE_IMPL; -#[cfg(windows)] -pub const PRIVACY_MODE_IMPL_WIN_EXCLUDE_FROM_CAPTURE: &str = - win_exclude_from_capture::PRIVACY_MODE_IMPL; - -#[cfg(windows)] -pub const PRIVACY_MODE_IMPL_WIN_VIRTUAL_DISPLAY: &str = win_virtual_display::PRIVACY_MODE_IMPL; +pub const PRIVACY_MODE_IMPL_WIN_MAG: &str = "privacy_mode_impl_mag"; +pub const PRIVACY_MODE_IMPL_WIN_EXCLUDE_FROM_CAPTURE: &str = "privacy_mode_impl_exclude_from_capture"; +pub const PRIVACY_MODE_IMPL_WIN_VIRTUAL_DISPLAY: &str = "privacy_mode_impl_virtual_display"; #[derive(Debug, Serialize, Deserialize, Clone)] #[serde(tag = "t", content = "c")] diff --git a/src/privacy_mode/win_exclude_from_capture.rs b/src/privacy_mode/win_exclude_from_capture.rs index 63164f838..7d680011f 100644 --- a/src/privacy_mode/win_exclude_from_capture.rs +++ b/src/privacy_mode/win_exclude_from_capture.rs @@ -2,7 +2,7 @@ use hbb_common::platform::windows::is_windows_version_or_greater; pub use super::win_topmost_window::PrivacyModeImpl; -pub(super) const PRIVACY_MODE_IMPL: &str = "privacy_mode_impl_exclude_from_capture"; +pub(super) const PRIVACY_MODE_IMPL: &str = super::PRIVACY_MODE_IMPL_WIN_EXCLUDE_FROM_CAPTURE; pub(super) fn is_supported() -> bool { // https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowdisplayaffinity diff --git a/src/privacy_mode/win_mag.rs b/src/privacy_mode/win_mag.rs index a93dce350..6235c2483 100644 --- a/src/privacy_mode/win_mag.rs +++ b/src/privacy_mode/win_mag.rs @@ -4,7 +4,7 @@ use std::time::Instant; pub use super::win_topmost_window::PrivacyModeImpl; -pub(super) const PRIVACY_MODE_IMPL: &str = "privacy_mode_impl_mag"; +pub(super) const PRIVACY_MODE_IMPL: &str = super::PRIVACY_MODE_IMPL_WIN_MAG; pub fn create_capturer( privacy_mode_id: i32, diff --git a/src/privacy_mode/win_virtual_display.rs b/src/privacy_mode/win_virtual_display.rs index 7e322ebbf..afaafa865 100644 --- a/src/privacy_mode/win_virtual_display.rs +++ b/src/privacy_mode/win_virtual_display.rs @@ -27,7 +27,7 @@ use winapi::{ }, }; -pub(super) const PRIVACY_MODE_IMPL: &str = "privacy_mode_impl_virtual_display"; +pub(super) const PRIVACY_MODE_IMPL: &str = super::PRIVACY_MODE_IMPL_WIN_VIRTUAL_DISPLAY; const CONFIG_KEY_REG_RECOVERY: &str = "reg_recovery";