patch: update UI, clear previous FUSE

- UI updated, now allow copy and paste file in Linux
- Too hard to implement graceful shutdown for rustdesk, just clear
  previously mounted FUSE should also works

Signed-off-by: ClSlaid <cailue@bupt.edu.cn>
This commit is contained in:
ClSlaid
2023-10-07 17:26:20 +08:00
parent d2a5edda46
commit a597c3f835
11 changed files with 81 additions and 22 deletions

View File

@@ -198,6 +198,18 @@ pub fn get_rx_cliprdr_server(conn_id: i32) -> Arc<TokioMutex<UnboundedReceiver<C
#[inline]
fn send_data(conn_id: i32, data: ClipboardFile) {
#[cfg(target_os = "windows")]
return send_data_to_channel(conn_id, data);
#[cfg(not(target_os = "windows"))]
if conn_id == 0 {
send_data_to_all(data);
} else {
send_data_to_channel(conn_id, data);
}
}
#[inline]
fn send_data_to_channel(conn_id: i32, data: ClipboardFile) {
// no need to handle result here
if let Some(msg_channel) = VEC_MSG_CHANNEL
.read()
@@ -205,10 +217,20 @@ fn send_data(conn_id: i32, data: ClipboardFile) {
.iter()
.find(|x| x.conn_id == conn_id)
{
log::debug!("send data to connection: {}", conn_id);
allow_err!(msg_channel.sender.send(data));
}
}
#[inline]
fn send_data_to_all(data: ClipboardFile) {
// no need to handle result here
for msg_channel in VEC_MSG_CHANNEL.read().unwrap().iter() {
log::debug!("send data to connection: {}", msg_channel.conn_id);
allow_err!(msg_channel.sender.send(data.clone()));
}
}
#[cfg(test)]
mod tests {
// #[test]