vcl/osx/clipboard.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) New commits: commit 226e23d6a26bb3710712e9a865c6b222cd3db76f Author: Patrick Luby <plub...@libreoffice.org> AuthorDate: Tue Dec 26 19:15:22 2023 -0500 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Fri Dec 29 12:42:17 2023 +0100
tdf#144124 Detect if ownership has been lost The shortcut assumes that lost ownership notifications from the system clipboard will happen elsewhere. They do under normal conditions, but do not when some clipboard managers are running. So, explicitly check ownership to catch such cases. Change-Id: If54ca8c9908650c23c348e08231820ee7c2483e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161337 Tested-by: Jenkins Reviewed-by: Patrick Luby <plub...@libreoffice.org> (cherry picked from commit c5edeeffa900b8ddfda0f62d281eb9d49d9e01f0) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161323 Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/vcl/osx/clipboard.cxx b/vcl/osx/clipboard.cxx index 5d925b3b1954..f5be6f86c339 100644 --- a/vcl/osx/clipboard.cxx +++ b/vcl/osx/clipboard.cxx @@ -140,6 +140,14 @@ uno::Reference<datatransfer::XTransferable> SAL_CALL AquaClipboard::getContents( { osl::MutexGuard aGuard(m_aMutex); + // tdf#144124 Detect if ownership has been lost + // The shortcut assumes that lost ownership notifications from the + // system clipboard will happen elsewhere. They do under normal + // conditions, but do not when some clipboard managers are running. + // So, explicitly check ownership to catch such cases. + if (mIsSystemPasteboard) + applicationDidBecomeActive(nullptr); + // Shortcut: If we are clipboard owner already we don't need // to drag the data through the system clipboard if (mXClipboardContent.is())