vcl/osx/clipboard.cxx |    8 ++++++++
 1 file changed, 8 insertions(+)

New commits:
commit cefd36db5f9389dd6f7e605eca6711762a784966
Author:     Patrick Luby <plub...@libreoffice.org>
AuthorDate: Tue Dec 26 19:15:22 2023 -0500
Commit:     Patrick Luby <plub...@libreoffice.org>
CommitDate: Wed Dec 27 13:58:54 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>

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())

Reply via email to