mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-02 07:01:28 +03:00
fix: clipboard, windows, controlled side, formats (#8885)
* fix: clipboard, windows, controlled side, formats Signed-off-by: fufesou <linlong1266@gmail.com> * Clipboard, reuse ipc conn and send_raw() Signed-off-by: fufesou <linlong1266@gmail.com> * Clipboard, merge content buffer Signed-off-by: fufesou <linlong1266@gmail.com> * refact: clipboard service, ipc stream Signed-off-by: fufesou <linlong1266@gmail.com> --------- Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
36
src/ipc.rs
36
src/ipc.rs
@@ -1,10 +1,3 @@
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
sync::atomic::{AtomicBool, Ordering},
|
||||
};
|
||||
#[cfg(not(windows))]
|
||||
use std::{fs::File, io::prelude::*};
|
||||
|
||||
use crate::{
|
||||
privacy_mode::PrivacyModeState,
|
||||
ui_interface::{get_local_option, set_local_option},
|
||||
@@ -14,6 +7,12 @@ use parity_tokio_ipc::{
|
||||
Connection as Conn, ConnectionClient as ConnClient, Endpoint, Incoming, SecurityAttributes,
|
||||
};
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
sync::atomic::{AtomicBool, Ordering},
|
||||
};
|
||||
#[cfg(not(windows))]
|
||||
use std::{fs::File, io::prelude::*};
|
||||
|
||||
#[cfg(all(feature = "flutter", feature = "plugin_framework"))]
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
@@ -26,8 +25,11 @@ use hbb_common::{
|
||||
config::{self, Config, Config2},
|
||||
futures::StreamExt as _,
|
||||
futures_util::sink::SinkExt,
|
||||
log, password_security as password, timeout, tokio,
|
||||
tokio::io::{AsyncRead, AsyncWrite},
|
||||
log, password_security as password, timeout,
|
||||
tokio::{
|
||||
self,
|
||||
io::{AsyncRead, AsyncWrite},
|
||||
},
|
||||
tokio_util::codec::Framed,
|
||||
ResultType,
|
||||
};
|
||||
@@ -100,6 +102,20 @@ pub enum FS {
|
||||
},
|
||||
}
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||
#[serde(tag = "t")]
|
||||
pub struct ClipboardNonFile {
|
||||
pub compress: bool,
|
||||
pub content: bytes::Bytes,
|
||||
pub content_len: usize,
|
||||
pub next_raw: bool,
|
||||
pub width: i32,
|
||||
pub height: i32,
|
||||
// message.proto: ClipboardFormat
|
||||
pub format: i32,
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||
#[serde(tag = "t", content = "c")]
|
||||
@@ -207,6 +223,8 @@ pub enum Data {
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
ClipboardFile(ClipboardFile),
|
||||
ClipboardFileEnabled(bool),
|
||||
#[cfg(target_os = "windows")]
|
||||
ClipboardNonFile(Option<(String, Vec<ClipboardNonFile>)>),
|
||||
PrivacyModeState((i32, PrivacyModeState, String)),
|
||||
TestRendezvousServer,
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
|
||||
Reference in New Issue
Block a user