From 20d83ab198fe9074455425622fd1f9bd6523e8c5 Mon Sep 17 00:00:00 2001 From: Oscar Hinton Date: Mon, 16 Sep 2024 15:16:28 +0200 Subject: [PATCH] [PM-2718] Set nspasteboard.ConcealedType for clipboard on MacOS (#11025) Enables the use of `exclude_from_clipboard` for macos, introduced in recent version of arboard --- apps/desktop/desktop_native/core/src/clipboard.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/desktop/desktop_native/core/src/clipboard.rs b/apps/desktop/desktop_native/core/src/clipboard.rs index cecf247865..bb3e3a4314 100644 --- a/apps/desktop/desktop_native/core/src/clipboard.rs +++ b/apps/desktop/desktop_native/core/src/clipboard.rs @@ -37,8 +37,14 @@ fn clipboard_set(set: Set, _password: bool) -> Set { } #[cfg(target_os = "macos")] -fn clipboard_set(set: Set, _password: bool) -> Set { - set +fn clipboard_set(set: Set, password: bool) -> Set { + use arboard::SetExtApple; + + if password { + set.exclude_from_history() + } else { + set + } } #[cfg(test)]