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")))]
|
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||||
fn try_stop_clipboard(_self_id: &str) {
|
fn try_stop_clipboard() {
|
||||||
#[cfg(feature = "flutter")]
|
#[cfg(feature = "flutter")]
|
||||||
if crate::flutter::sessions::other_sessions_running(
|
if crate::flutter::sessions::has_sessions_running(ConnType::DEFAULT_CONN) {
|
||||||
_self_id.to_string(),
|
|
||||||
ConnType::DEFAULT_CONN,
|
|
||||||
) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
TEXT_CLIPBOARD_STATE.lock().unwrap().running = false;
|
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")))]
|
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||||
if _set_disconnected_ok {
|
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"))]
|
#[cfg(any(target_os = "windows", target_os = "linux", target_os = "macos"))]
|
||||||
|
@ -1790,13 +1790,10 @@ pub mod sessions {
|
|||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||||
pub fn other_sessions_running(peer_id: String, conn_type: ConnType) -> bool {
|
pub fn has_sessions_running(conn_type: ConnType) -> bool {
|
||||||
SESSIONS
|
SESSIONS.read().unwrap().iter().any(|((_, r#type), s)| {
|
||||||
.read()
|
*r#type == conn_type && s.session_handlers.read().unwrap().len() != 0
|
||||||
.unwrap()
|
})
|
||||||
.get(&(peer_id, conn_type))
|
|
||||||
.map(|s| s.session_handlers.read().unwrap().len() != 0)
|
|
||||||
.unwrap_or(false)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user