From 99b565ef40408e1ddcb5432c206b87cddf8adef3 Mon Sep 17 00:00:00 2001 From: s1korrrr Date: Tue, 28 Apr 2026 04:55:28 +0200 Subject: [PATCH] fix(iOS): preserve local pasteboard sync from Windows hosts (#14659) * fix(ios): accept windows clipboard updates locally Signed-off-by: Rafal * docs: document clipboard text helpers * fix(iOS): sync clipboard, debug Signed-off-by: fufesou --------- Signed-off-by: Rafal Signed-off-by: fufesou Co-authored-by: fufesou --- src/client/io_loop.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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 Remote { 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); }