[Libreoffice-commits] core.git: vcl/unx
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Tue Nov 17 08:54:38 UTC 2020
vcl/unx/gtk3/gtk3gtkinst.cxx | 13 +++++++++++++
1 file changed, 13 insertions(+)
New commits:
commit f98735583a666e0f06d018cf93b79c74b7ce7b80
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Nov 16 12:36:57 2020 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Nov 17 09:53:57 2020 +0100
tdf#138183 sync pending clipboard assign on clipboard ownership-change
Change-Id: I325add499fbd4d11a942ce550346dcbcb5343e4d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105928
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index fb5227df063d..be37b2b49c02 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -750,6 +750,7 @@ public:
void ClipboardClear();
void OwnerPossiblyChanged(GtkClipboard *clipboard);
void SetGtkClipboard();
+ void SyncGtkClipboard();
};
}
@@ -835,6 +836,7 @@ namespace
void VclGtkClipboard::OwnerPossiblyChanged(GtkClipboard* clipboard)
{
+ SyncGtkClipboard(); // tdf#138183 do any pending SetGtkClipboard calls
if (!m_aContents.is())
return;
@@ -1049,6 +1051,17 @@ IMPL_LINK_NOARG(VclGtkClipboard, AsyncSetGtkClipboard, void*, void)
SetGtkClipboard();
}
+void VclGtkClipboard::SyncGtkClipboard()
+{
+ osl::ClearableMutexGuard aGuard(m_aMutex);
+ if (m_pSetClipboardEvent)
+ {
+ Application::RemoveUserEvent(m_pSetClipboardEvent);
+ m_pSetClipboardEvent = nullptr;
+ SetGtkClipboard();
+ }
+}
+
void VclGtkClipboard::SetGtkClipboard()
{
GtkClipboard* clipboard = gtk_clipboard_get(m_nSelection);
More information about the Libreoffice-commits
mailing list