[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - vcl/unx
Caolán McNamara
caolanm at redhat.com
Mon Nov 14 09:25:56 UTC 2016
vcl/unx/gtk3/gtk3gtkframe.cxx | 39 +++++++++++++++++++++++++++------------
1 file changed, 27 insertions(+), 12 deletions(-)
New commits:
commit 015061495373d7c09362b175dc1f6be3f2a37a1a
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Oct 25 09:38:36 2016 +0100
Resolves: tdf#103472 gtk3 dnd must clear listener after dragDropEnd dispatch
like the generic dnd impl does
Change-Id: Ie860c43329ee2f9332d12a53cd691ac7fcbb5eac
(cherry picked from commit 461e9cc64b5a6e9943db397d27c6415327386494)
Reviewed-on: https://gerrit.libreoffice.org/30260
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: David Tardon <dtardon at redhat.com>
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index 931ed03..812e4b8 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -4195,10 +4195,15 @@ void GtkSalFrame::startDrag(gint nButton, gint nDragOriginX, gint nDragOriginY,
void GtkDragSource::dragFailed()
{
- datatransfer::dnd::DragSourceDropEvent aEv;
- aEv.DropAction = datatransfer::dnd::DNDConstants::ACTION_NONE;
- aEv.DropSuccess = false;
- m_xListener->dragDropEnd(aEv);
+ if (m_xListener.is())
+ {
+ datatransfer::dnd::DragSourceDropEvent aEv;
+ aEv.DropAction = datatransfer::dnd::DNDConstants::ACTION_NONE;
+ aEv.DropSuccess = false;
+ auto xListener = m_xListener;
+ m_xListener.clear();
+ xListener->dragDropEnd(aEv);
+ }
}
gboolean GtkSalFrame::signalDragFailed(GtkWidget* /*widget*/, GdkDragContext* /*context*/, GtkDragResult /*result*/, gpointer frame)
@@ -4212,10 +4217,15 @@ gboolean GtkSalFrame::signalDragFailed(GtkWidget* /*widget*/, GdkDragContext* /*
void GtkDragSource::dragDelete()
{
- datatransfer::dnd::DragSourceDropEvent aEv;
- aEv.DropAction = datatransfer::dnd::DNDConstants::ACTION_MOVE;
- aEv.DropSuccess = true;
- m_xListener->dragDropEnd(aEv);
+ if (m_xListener.is())
+ {
+ datatransfer::dnd::DragSourceDropEvent aEv;
+ aEv.DropAction = datatransfer::dnd::DNDConstants::ACTION_MOVE;
+ aEv.DropSuccess = true;
+ auto xListener = m_xListener;
+ m_xListener.clear();
+ xListener->dragDropEnd(aEv);
+ }
}
void GtkSalFrame::signalDragDelete(GtkWidget* /*widget*/, GdkDragContext* /*context*/, gpointer frame)
@@ -4228,10 +4238,15 @@ void GtkSalFrame::signalDragDelete(GtkWidget* /*widget*/, GdkDragContext* /*cont
void GtkDragSource::dragEnd(GdkDragContext* context)
{
- datatransfer::dnd::DragSourceDropEvent aEv;
- aEv.DropAction = GdkToVcl(gdk_drag_context_get_selected_action(context));
- aEv.DropSuccess = gdk_drag_drop_succeeded(context);
- m_xListener->dragDropEnd(aEv);
+ if (m_xListener.is())
+ {
+ datatransfer::dnd::DragSourceDropEvent aEv;
+ aEv.DropAction = GdkToVcl(gdk_drag_context_get_selected_action(context));
+ aEv.DropSuccess = gdk_drag_drop_succeeded(context);
+ auto xListener = m_xListener;
+ m_xListener.clear();
+ xListener->dragDropEnd(aEv);
+ }
g_ActiveDragSource = nullptr;
}
More information about the Libreoffice-commits
mailing list