opt: release clipboard config lock before updates (#15277)

Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
21pages
2026-06-14 17:27:19 +08:00
committed by GitHub
parent 78533e428e
commit b73e5bbfa0

View File

@@ -1426,8 +1426,11 @@ impl<T: InvokeUiSession> Remote<T> {
self.handler.set_cursor_position(cp);
}
Some(message::Union::Clipboard(cb)) => {
let lc = self.handler.lc.read().unwrap();
if !lc.disable_clipboard.v && !lc.view_only.v {
let clipboard_allowed = {
let lc = self.handler.lc.read().unwrap();
!lc.disable_clipboard.v && !lc.view_only.v
};
if clipboard_allowed {
#[cfg(not(any(target_os = "android", target_os = "ios")))]
update_clipboard(vec![cb], ClipboardSide::Client);
#[cfg(target_os = "ios")]
@@ -1446,8 +1449,11 @@ impl<T: InvokeUiSession> Remote<T> {
}
}
Some(message::Union::MultiClipboards(_mcb)) => {
let lc = self.handler.lc.read().unwrap();
if !lc.disable_clipboard.v && !lc.view_only.v {
let clipboard_allowed = {
let lc = self.handler.lc.read().unwrap();
!lc.disable_clipboard.v && !lc.view_only.v
};
if clipboard_allowed {
#[cfg(not(any(target_os = "android", target_os = "ios")))]
update_clipboard(_mcb.clipboards, ClipboardSide::Client);
#[cfg(target_os = "ios")]