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 );