From af77818e8a37eb53fa868250366a44327b63b406 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 24 Jun 2021 08:45:07 +0100 Subject: gtk4: simplify dnd "drop" signal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I2d4714194516c6b8270fa96c8c5a6b75d2d10b86 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117760 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara --- vcl/unx/gtk3/gtkframe.cxx | 35 +---------------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) (limited to 'vcl') 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(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(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) -- cgit