fix clipboard update B->A->B

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2023-04-10 14:30:38 +08:00
parent fff7feec4c
commit ceb2e6614c
4 changed files with 33 additions and 16 deletions

View File

@@ -725,9 +725,9 @@ pub fn other_sessions_running(id: &str) -> bool {
}
#[cfg(not(any(target_os = "android", target_os = "ios")))]
pub fn send_text_clipboard_msg(msg: Message) {
pub fn send_text_clipboard_msg(text: &str, msg: Message) {
for (_id, session) in SESSIONS.read().unwrap().iter() {
if session.is_text_clipboard_required() {
if session.is_text_clipboard_required() && text != *session.old_clipboard.lock().unwrap() {
session.send(Data::Message(msg.clone()));
}
}