diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-06-24 08:45:07 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-06-24 21:39:47 +0200 |
commit | af77818e8a37eb53fa868250366a44327b63b406 (patch) | |
tree | 720228a1a769da2bc1823dd444e9864dcf60f14a /vcl | |
parent | bf7c5127d3ff8d699f2b44e6c3011209cf7848e0 (diff) |
gtk4: simplify dnd "drop" signal
Change-Id: I2d4714194516c6b8270fa96c8c5a6b75d2d10b86
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117760
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/gtk3/gtkframe.cxx | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/vcl/unx/gtk3/gtkframe.cxx b/vcl/unx/gtk3/gtkframe.cxx index a500af13a0d4..ffc934687344 100644 --- a/vcl/unx/gtk3/gtkframe.cxx +++ b/vcl/unx/gtk3/gtkframe.cxx @@ -4492,45 +4492,12 @@ GtkInstDragSource* GtkInstDragSource::g_ActiveDragSource; #if GTK_CHECK_VERSION(4, 0, 0) -struct GrabBag -{ - GtkInstDropTarget* m_pDropTarget; - GtkDropTargetAsync* m_pContext; - GdkDrop* m_pDrop; - double m_nX; - double m_nY; - - GrabBag(GtkInstDropTarget* pDropTarget, - GtkDropTargetAsync* pContext, - GdkDrop* pDrop, - double nX, - double nY) - : m_pDropTarget(pDropTarget) - , m_pContext(pContext) - , m_pDrop(pDrop) - , m_nX(nX) - , m_nY(nY) - { - } -}; - -static gboolean lcl_deferred_dragDrop(gpointer user_data) -{ - GrabBag* pGrabBag = static_cast<GrabBag*>(user_data); - pGrabBag->m_pDropTarget->signalDragDrop(pGrabBag->m_pContext, pGrabBag->m_pDrop, pGrabBag->m_nX, pGrabBag->m_nY); - g_object_unref(pGrabBag->m_pDrop); - return false; -} - gboolean GtkSalFrame::signalDragDrop(GtkDropTargetAsync* context, GdkDrop* drop, double x, double y, gpointer frame) { GtkSalFrame* pThis = static_cast<GtkSalFrame*>(frame); if (!pThis->m_pDropTarget) return false; - g_object_ref(drop); - g_idle_add(lcl_deferred_dragDrop, new GrabBag(pThis->m_pDropTarget, context, drop, x, y)); -// return pThis->m_pDropTarget->signalDragDrop(context, drop, x, y); - return true; + return pThis->m_pDropTarget->signalDragDrop(context, drop, x, y); } #else gboolean GtkSalFrame::signalDragDrop(GtkWidget* pWidget, GdkDragContext* context, gint x, gint y, guint time, gpointer frame) |