From 469db76712fa4ac46df6f04e5be92ef87d1674a9 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 3 Nov 2007 21:46:55 +0000 Subject: [PATCH] handle failure of gtk_drag_begin() (which can happen e.g. because gdk_pointer_grab() failed) in DoDragDrop() (patch 1825237) + minor cleanup in trunk version of the code git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@49608 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/dnd.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/gtk/dnd.cpp b/src/gtk/dnd.cpp index 0733a6e2e4..ce1c92472a 100644 --- a/src/gtk/dnd.cpp +++ b/src/gtk/dnd.cpp @@ -901,6 +901,16 @@ wxDragResult wxDropSource::DoDragDrop(int flags) g_lastButtonNumber, // number of mouse button which started drag (GdkEvent*) g_lastMouseEvent ); + if ( !context ) + { + // this can happen e.g. if gdk_pointer_grab() failed + g_blockEventsOnDrag = false; + + UnregisterWindow(); + + return wxDragError; + } + m_dragContext = context; PrepareIcon( action, context );