From 5817e48e1785967c6e646a516b1e08e50ab7dc39 Mon Sep 17 00:00:00 2001 From: dignow Date: Sat, 5 Aug 2023 19:20:20 +0800 Subject: [PATCH] fix build Signed-off-by: dignow --- src/client/io_loop.rs | 4 ++++ src/flutter_ffi.rs | 1 + src/ui_session_interface.rs | 3 +++ 3 files changed, 8 insertions(+) diff --git a/src/client/io_loop.rs b/src/client/io_loop.rs index 400aff2d1..eee857f60 100644 --- a/src/client/io_loop.rs +++ b/src/client/io_loop.rs @@ -1009,6 +1009,7 @@ impl Remote { } Some(login_response::Union::PeerInfo(pi)) => { #[cfg(feature = "flutter")] + #[cfg(not(any(target_os = "android", target_os = "ios")))] { self.handler.cache_flutter.write().unwrap().pi = pi.clone(); } @@ -1060,6 +1061,7 @@ impl Remote { }, Some(message::Union::CursorData(cd)) => { #[cfg(feature = "flutter")] + #[cfg(not(any(target_os = "android", target_os = "ios")))] { let mut lock = self.handler.cache_flutter.write().unwrap(); if !lock.cursor_data.contains_key(&cd.id) { @@ -1070,6 +1072,7 @@ impl Remote { } Some(message::Union::CursorId(id)) => { #[cfg(feature = "flutter")] + #[cfg(not(any(target_os = "android", target_os = "ios")))] { self.handler.cache_flutter.write().unwrap().cursor_id = id; } @@ -1290,6 +1293,7 @@ impl Remote { } Some(misc::Union::SwitchDisplay(s)) => { #[cfg(feature = "flutter")] + #[cfg(not(any(target_os = "android", target_os = "ios")))] { self.handler .cache_flutter diff --git a/src/flutter_ffi.rs b/src/flutter_ffi.rs index c0e96a487..05819dfd8 100644 --- a/src/flutter_ffi.rs +++ b/src/flutter_ffi.rs @@ -602,6 +602,7 @@ pub fn session_change_resolution(session_id: SessionID, display: i32, width: i32 } pub fn session_restore_cache(session_id: SessionID) { + #[cfg(not(any(target_os = "android", target_os = "ios")))] if let Some(session) = SESSIONS.write().unwrap().get_mut(&session_id) { session.restore_flutter_cache(); } diff --git a/src/ui_session_interface.rs b/src/ui_session_interface.rs index 1e0f6b1b9..21b9c9d9e 100644 --- a/src/ui_session_interface.rs +++ b/src/ui_session_interface.rs @@ -49,6 +49,7 @@ pub static IS_IN: AtomicBool = AtomicBool::new(false); const CHANGE_RESOLUTION_VALID_TIMEOUT_SECS: u64 = 15; #[cfg(feature = "flutter")] +#[cfg(not(any(target_os = "android", target_os = "ios")))] #[derive(Default)] pub struct CacheFlutter { pub pi: PeerInfo, @@ -72,6 +73,7 @@ pub struct Session { pub server_clipboard_enabled: Arc>, pub last_change_display: Arc>, #[cfg(feature = "flutter")] + #[cfg(not(any(target_os = "android", target_os = "ios")))] pub cache_flutter: Arc>, } @@ -1194,6 +1196,7 @@ impl Session { } #[cfg(feature = "flutter")] + #[cfg(not(any(target_os = "android", target_os = "ios")))] pub fn restore_flutter_cache(&mut self) { let pi = self.cache_flutter.read().unwrap().pi.clone(); self.handle_peer_info(pi);