fix: win, file clipboard, try empty (#10609)

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou
2025-01-27 16:16:44 +08:00
committed by GitHub
parent f08cb0412d
commit 55005f8129
5 changed files with 72 additions and 7 deletions

View File

@@ -107,6 +107,7 @@ pub enum ClipboardFile {
stream_id: i32,
requested_data: Vec<u8>,
},
TryEmpty,
}
struct MsgChannel {
@@ -226,6 +227,16 @@ fn send_data_to_channel(conn_id: i32, data: ClipboardFile) -> ResultType<()> {
}
}
#[cfg(target_os = "windows")]
pub fn send_data_exclude(conn_id: i32, data: ClipboardFile) {
use hbb_common::log;
for msg_channel in VEC_MSG_CHANNEL.read().unwrap().iter() {
if msg_channel.conn_id != conn_id {
allow_err!(msg_channel.sender.send(data.clone()));
}
}
}
#[cfg(feature = "unix-file-copy-paste")]
#[inline]
fn send_data_to_all(data: ClipboardFile) -> ResultType<()> {