mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-23 21:21:05 +03:00
comments (#9297)
* comments Signed-off-by: fufesou <linlong1266@gmail.com> * comments Signed-off-by: fufesou <linlong1266@gmail.com> --------- Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
@@ -131,9 +131,12 @@ impl Handler {
|
||||
check_clipboard(&mut self.ctx, ClipboardSide::Host, false)
|
||||
}
|
||||
|
||||
// It's ok to do async operation in the clipboard service because:
|
||||
// 1. the clipboard is not used frequently.
|
||||
// 2. the clipboard handle is sync and will not block the main thread.
|
||||
// Read clipboard data from cm using ipc.
|
||||
//
|
||||
// We cannot use `#[tokio::main(flavor = "current_thread")]` here,
|
||||
// because the auto-managed tokio runtime (async context) will be dropped after the call.
|
||||
// The next call will create a new runtime, which will cause the previous stream to be unusable.
|
||||
// So we need to manage the tokio runtime manually.
|
||||
#[cfg(windows)]
|
||||
fn read_clipboard_from_cm_ipc(&mut self) -> ResultType<Vec<ClipboardNonFile>> {
|
||||
if self.rt.is_none() {
|
||||
|
||||
Reference in New Issue
Block a user