refact: file copy&paste, cross platform (no macOS) (#10671)

* feat: unix, file copy&paste

Signed-off-by: fufesou <linlong1266@gmail.com>

* refact: unix file c&p, check peer version

Signed-off-by: fufesou <linlong1266@gmail.com>

* Update pubspec.yaml

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
This commit is contained in:
fufesou
2025-02-04 20:33:02 +08:00
committed by GitHub
parent a27fa43081
commit fbba8f0b34
42 changed files with 2026 additions and 1778 deletions

View File

@@ -162,6 +162,13 @@ impl SessionPermissionConfig {
&& *self.server_keyboard_enabled.read().unwrap()
&& !self.lc.read().unwrap().disable_clipboard.v
}
#[cfg(feature = "unix-file-copy-paste")]
pub fn is_file_clipboard_required(&self) -> bool {
*self.server_keyboard_enabled.read().unwrap()
&& *self.server_file_transfer_enabled.read().unwrap()
&& self.lc.read().unwrap().enable_file_copy_paste.v
}
}
impl<T: InvokeUiSession> Session<T> {
@@ -324,7 +331,7 @@ impl<T: InvokeUiSession> Session<T> {
pub fn toggle_option(&self, name: String) {
let msg = self.lc.write().unwrap().toggle_option(name.clone());
#[cfg(not(feature = "flutter"))]
#[cfg(all(target_os = "windows", not(feature = "flutter")))]
if name == hbb_common::config::keys::OPTION_ENABLE_FILE_COPY_PASTE {
self.send(Data::ToggleClipboardFile);
}
@@ -361,6 +368,13 @@ impl<T: InvokeUiSession> Session<T> {
&& !self.lc.read().unwrap().disable_clipboard.v
}
#[cfg(any(target_os = "windows", feature = "unix-file-copy-paste"))]
pub fn is_file_clipboard_required(&self) -> bool {
*self.server_keyboard_enabled.read().unwrap()
&& *self.server_file_transfer_enabled.read().unwrap()
&& self.lc.read().unwrap().enable_file_copy_paste.v
}
#[cfg(feature = "flutter")]
pub fn refresh_video(&self, display: i32) {
if crate::common::is_support_multi_ui_session_num(self.lc.read().unwrap().version) {