mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-01-19 08:23:01 +08:00
Fix. Text clipboard is not working correctly (#7226)
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
parent
d7d7be9366
commit
09325fadaf
@ -702,12 +702,9 @@ impl Client {
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
fn try_stop_clipboard(_self_id: &str) {
|
||||
fn try_stop_clipboard() {
|
||||
#[cfg(feature = "flutter")]
|
||||
if crate::flutter::sessions::other_sessions_running(
|
||||
_self_id.to_string(),
|
||||
ConnType::DEFAULT_CONN,
|
||||
) {
|
||||
if crate::flutter::sessions::has_sessions_running(ConnType::DEFAULT_CONN) {
|
||||
return;
|
||||
}
|
||||
TEXT_CLIPBOARD_STATE.lock().unwrap().running = false;
|
||||
|
@ -286,7 +286,7 @@ impl<T: InvokeUiSession> Remote<T> {
|
||||
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
if _set_disconnected_ok {
|
||||
Client::try_stop_clipboard(&self.handler.get_id());
|
||||
Client::try_stop_clipboard();
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "windows", target_os = "linux", target_os = "macos"))]
|
||||
|
@ -1790,13 +1790,10 @@ pub mod sessions {
|
||||
|
||||
#[inline]
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
pub fn other_sessions_running(peer_id: String, conn_type: ConnType) -> bool {
|
||||
SESSIONS
|
||||
.read()
|
||||
.unwrap()
|
||||
.get(&(peer_id, conn_type))
|
||||
.map(|s| s.session_handlers.read().unwrap().len() != 0)
|
||||
.unwrap_or(false)
|
||||
pub fn has_sessions_running(conn_type: ConnType) -> bool {
|
||||
SESSIONS.read().unwrap().iter().any(|((_, r#type), s)| {
|
||||
*r#type == conn_type && s.session_handlers.read().unwrap().len() != 0
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user