better conditional compilation

Signed-off-by: dignow <linlong1265@gmail.com>
This commit is contained in:
dignow
2023-06-24 21:09:45 +08:00
parent b9652d165b
commit d15deabba5
10 changed files with 147 additions and 94 deletions

View File

@@ -63,6 +63,7 @@ lazy_static::lazy_static! {
static ref SWITCH_SIDES_UUID: Arc::<Mutex<HashMap<String, (Instant, uuid::Uuid)>>> = Default::default();
}
pub static CLICK_TIME: AtomicI64 = AtomicI64::new(0);
#[cfg(not(any(target_os = "android", target_os = "ios")))]
pub static MOUSE_MOVE_TIME: AtomicI64 = AtomicI64::new(0);
#[cfg(all(feature = "flutter", feature = "plugin_framework"))]
@@ -163,6 +164,7 @@ pub struct Connection {
// by peer
disable_audio: bool,
// by peer
#[cfg(windows)]
enable_file_transfer: bool,
// by peer
audio_sender: Option<MediaSender>,
@@ -291,6 +293,7 @@ impl Connection {
show_remote_cursor: false,
ip: "".to_owned(),
disable_audio: false,
#[cfg(windows)]
enable_file_transfer: false,
disable_clipboard: false,
disable_keyboard: false,
@@ -1112,6 +1115,7 @@ impl Connection {
self.audio && !self.disable_audio
}
#[cfg(windows)]
fn file_transfer_enabled(&self) -> bool {
self.file && self.enable_file_transfer
}