[Libreoffice-commits] core.git: vcl/unx

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu Nov 5 14:03:06 UTC 2020


 vcl/unx/gtk3/gtk3gtkinst.cxx |   17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

New commits:
commit e2f66f5ba5d813af97bc4fb5f28cea9d737e25e9
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Nov 5 10:48:30 2020 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Nov 5 15:02:18 2020 +0100

    Related: tdf#137181 factor out the piece that triggers the problem
    
    Change-Id: Ic74f7c972988d6a26f7e5e34354fe05da4601f41
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105338
    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 81b69554b438..92298a2d0bd7 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -747,6 +747,7 @@ public:
     void ClipboardGet(GtkSelectionData *selection_data, guint info);
     void ClipboardClear();
     void OwnerPossiblyChanged(GtkClipboard *clipboard);
+    void SetGtkClipboard();
 };
 
 }
@@ -1032,6 +1033,14 @@ std::vector<GtkTargetEntry> VclToGtkHelper::FormatsToGtk(const css::uno::Sequenc
     return aGtkTargets;
 }
 
+void VclGtkClipboard::SetGtkClipboard()
+{
+    GtkClipboard* clipboard = gtk_clipboard_get(m_nSelection);
+    gtk_clipboard_set_with_data(clipboard, m_aGtkTargets.data(), m_aGtkTargets.size(),
+                                ClipboardGetFunc, ClipboardClearFunc, this);
+    gtk_clipboard_set_can_store(clipboard, m_aGtkTargets.data(), m_aGtkTargets.size());
+}
+
 void VclGtkClipboard::setContents(
         const Reference< css::datatransfer::XTransferable >& xTrans,
         const Reference< css::datatransfer::clipboard::XClipboardOwner >& xClipboardOwner )
@@ -1070,12 +1079,10 @@ void VclGtkClipboard::setContents(
             aEntry.info = 0;
             aGtkTargets.push_back(aEntry);
 
-            gtk_clipboard_set_with_data(clipboard, aGtkTargets.data(), aGtkTargets.size(),
-                                        ClipboardGetFunc, ClipboardClearFunc, this);
-            gtk_clipboard_set_can_store(clipboard, aGtkTargets.data(), aGtkTargets.size());
-        }
+            m_aGtkTargets = aGtkTargets;
 
-        m_aGtkTargets = aGtkTargets;
+            SetGtkClipboard();
+        }
     }
 
     aEv.Contents = getContents();


More information about the Libreoffice-commits mailing list