diff options
author | Patrick Luby <plubius@libreoffice.org> | 2023-12-26 19:15:22 -0500 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-12-29 12:42:10 +0100 |
commit | 0e014306349e51b187322bc98b5e23644d017b85 (patch) | |
tree | 0e0682316dee3315ed874e6641aff6934fe99173 /vcl | |
parent | 7e4fd3c226d440d167a6581f82d8a83b628bcaa4 (diff) |
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 <plubius@libreoffice.org>
(cherry picked from commit c5edeeffa900b8ddfda0f62d281eb9d49d9e01f0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161322
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/osx/clipboard.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
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()) |