parent
9ed2499666
commit
1c62a28ef3
@ -122,6 +122,28 @@ impl<T: InvokeUiSession> Remote<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub async fn io_loop(&mut self, key: &str, token: &str, round: u32) {
|
pub async fn io_loop(&mut self, key: &str, token: &str, round: u32) {
|
||||||
|
#[cfg(any(target_os = "windows", target_os = "linux", target_os = "macos"))]
|
||||||
|
let _file_clip_context_holder = {
|
||||||
|
// `is_port_forward()` will not reach here, but we still check it for clarity.
|
||||||
|
if !self.handler.is_file_transfer() && !self.handler.is_port_forward() {
|
||||||
|
// It is ok to call this function multiple times.
|
||||||
|
ContextSend::enable(true);
|
||||||
|
Some(crate::SimpleCallOnReturn {
|
||||||
|
b: true,
|
||||||
|
f: Box::new(|| {
|
||||||
|
// No need to call `enable(false)` for sciter version, because each client of sciter version is a new process.
|
||||||
|
// It's better to check if the peers are windows(support file copy&paste), but it's not necessary.
|
||||||
|
#[cfg(feature = "flutter")]
|
||||||
|
if !crate::flutter::sessions::has_sessions_running(ConnType::DEFAULT_CONN) {
|
||||||
|
ContextSend::enable(false);
|
||||||
|
};
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
let mut last_recv_time = Instant::now();
|
let mut last_recv_time = Instant::now();
|
||||||
let mut received = false;
|
let mut received = false;
|
||||||
let conn_type = if self.handler.is_file_transfer() {
|
let conn_type = if self.handler.is_file_transfer() {
|
||||||
@ -310,12 +332,6 @@ impl<T: InvokeUiSession> Remote<T> {
|
|||||||
Ok(())
|
Ok(())
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// It's better to check if the peers are windows, but it's not necessary.
|
|
||||||
#[cfg(feature = "flutter")]
|
|
||||||
if !crate::flutter::sessions::has_sessions_running(ConnType::DEFAULT_CONN) {
|
|
||||||
ContextSend::enable(false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(any(target_os = "windows", target_os = "linux", target_os = "macos"))]
|
#[cfg(any(target_os = "windows", target_os = "linux", target_os = "macos"))]
|
||||||
|
@ -1739,18 +1739,6 @@ impl<T: InvokeUiSession> Session<T> {
|
|||||||
|
|
||||||
#[tokio::main(flavor = "current_thread")]
|
#[tokio::main(flavor = "current_thread")]
|
||||||
pub async fn io_loop<T: InvokeUiSession>(handler: Session<T>, round: u32) {
|
pub async fn io_loop<T: InvokeUiSession>(handler: Session<T>, round: u32) {
|
||||||
// It is ok to call this function multiple times.
|
|
||||||
#[cfg(any(
|
|
||||||
target_os = "windows",
|
|
||||||
all(
|
|
||||||
any(target_os = "linux", target_os = "macos"),
|
|
||||||
feature = "unix-file-copy-paste"
|
|
||||||
)
|
|
||||||
))]
|
|
||||||
if !handler.is_file_transfer() && !handler.is_port_forward() {
|
|
||||||
clipboard::ContextSend::enable(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(any(target_os = "android", target_os = "ios"))]
|
#[cfg(any(target_os = "android", target_os = "ios"))]
|
||||||
let (sender, receiver) = mpsc::unbounded_channel::<Data>();
|
let (sender, receiver) = mpsc::unbounded_channel::<Data>();
|
||||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user