diff --git a/libs/clipboard/src/lib.rs b/libs/clipboard/src/lib.rs index 0e80cda2d..1a9a04757 100644 --- a/libs/clipboard/src/lib.rs +++ b/libs/clipboard/src/lib.rs @@ -4,8 +4,10 @@ use std::{ sync::{Arc, Mutex, RwLock}, }; +#[cfg(any(target_os = "windows", feature = "unix-file-copy-paste",))] +use hbb_common::{allow_err, log}; use hbb_common::{ - allow_err, lazy_static, log, + lazy_static, tokio::sync::{ mpsc::{unbounded_channel, UnboundedReceiver, UnboundedSender}, Mutex as TokioMutex, diff --git a/libs/clipboard/src/platform/windows.rs b/libs/clipboard/src/platform/windows.rs index 1576b4a78..1148112b5 100644 --- a/libs/clipboard/src/platform/windows.rs +++ b/libs/clipboard/src/platform/windows.rs @@ -10,11 +10,11 @@ use std::{ ffi::{CStr, CString}, result::Result, }; - use crate::{ - allow_err, log, send_data, ClipboardFile, CliprdrError, CliprdrServiceContext, ResultType, + allow_err, send_data, ClipboardFile, CliprdrError, CliprdrServiceContext, ResultType, ERR_CODE_INVALID_PARAMETER, ERR_CODE_SERVER_FUNCTION_NONE, VEC_MSG_CHANNEL, }; +use hbb_common::log; // only used error code will be recorded here /// success diff --git a/src/server.rs b/src/server.rs index 0e1abfd55..e019f1889 100644 --- a/src/server.rs +++ b/src/server.rs @@ -95,7 +95,7 @@ pub fn new() -> ServerPtr { id_count: hbb_common::rand::random::() % 1000 + 1000, // ensure positive }; server.add_service(Box::new(audio_service::new())); - #[cfg(not(any(target_os = "android", target_os = "ios")))] + #[cfg(not(target_os = "ios"))] server.add_service(Box::new(display_service::new())); server.add_service(Box::new(video_service::new( *display_service::PRIMARY_DISPLAY_IDX, diff --git a/src/server/display_service.rs b/src/server/display_service.rs index 318ead5f6..a9a49818c 100644 --- a/src/server/display_service.rs +++ b/src/server/display_service.rs @@ -12,6 +12,7 @@ use scrap::Display; pub const NAME: &'static str = "display"; +#[cfg(all(windows, feature = "virtual_display_driver"))] const DUMMY_DISPLAY_SIDE_MAX_SIZE: usize = 1024; struct ChangedResolution {