Skip to content

An open-source remote desktop application designed for self-hosting, as an alternative to TeamViewer.

fix(iOS): preserve local pasteboard sync from Windows hosts (#14659)

s1korrrr99b565ef4040
diff --git a/src/client/io_loop.rs b/src/client/io_loop.rs
index 78d9a4e40..e8afa8e01 100644
--- a/src/client/io_loop.rs
+++ b/src/client/io_loop.rs
@@ -1448,6 +1448,23 @@ impl<T: InvokeUiSession> Remote<T> {
if !self.handler.lc.read().unwrap().disable_clipboard.v {
#[cfg(not(any(target_os = "android", target_os = "ios")))]
update_clipboard(_mcb.clipboards, ClipboardSide::Client);
+ #[cfg(target_os = "ios")]
+ {
+ if let Some(cb) = _mcb
+ .clipboards
+ .iter()
+ .find(|c| c.format.enum_value() == Ok(ClipboardFormat::Text))
+ {
+ let content = if cb.compress {
+ hbb_common::compress::decompress(&cb.content)
+ } else {
+ cb.content.to_vec()
+ };
+ if let Ok(content) = String::from_utf8(content) {
+ self.handler.clipboard(content);
+ }
+ }
+ }
#[cfg(target_os = "android")]
crate::clipboard::handle_msg_multi_clipboards(_mcb);
}