+ // GTK+ always supposes that we want to copy the data by default while we
+ // might want to move it, so examine not only suggested_action - which is
+ // only good if we don't have our own preferences - but also the actions
+ // field
+ wxDragResult suggested_action = wxDragNone;
+ if (GetDefaultAction() == wxDragNone)
+ {
+ // use default action set by wxDropSource::DoDragDrop()
+ if ( (gs_flagsForDrag & wxDrag_DefaultMove) == wxDrag_DefaultMove &&
+ (m_dragContext->actions & GDK_ACTION_MOVE ) )
+ {
+ // move is requested by the program and allowed by GTK+ - do it, even
+ // though suggested_action may be currently wxDragCopy
+ suggested_action = wxDragMove;
+ }
+ else // use whatever GTK+ says we should
+ {
+ suggested_action = ConvertFromGTK(m_dragContext->suggested_action);
+
+#if 0
+ // RR: I don't understand the code below: if the drag comes from
+ // a different app, the gs_flagsForDrag is invalid; if it
+ // comes from the same wx app, then GTK+ hopefully won't
+ // suggest something we didn't allow in the frist place
+ // in DoDrop()
+ if ( (suggested_action == wxDragMove) && !(gs_flagsForDrag & wxDrag_AllowMove) )
+ {
+ // we're requested to move but we can't
+ suggested_action = wxDragCopy;
+ }
+#endif
+ }
+ }
+ else if (GetDefaultAction() == wxDragMove &&
+ (m_dragContext->actions & GDK_ACTION_MOVE))
+ {
+
+ suggested_action = wxDragMove;
+ }
+ else
+ {
+ if (m_dragContext->actions & GDK_ACTION_COPY)
+ suggested_action = wxDragCopy;
+ else if (m_dragContext->actions & GDK_ACTION_MOVE)
+ suggested_action = wxDragMove;
+ else if (m_dragContext->actions & GDK_ACTION_LINK)
+ suggested_action = wxDragLink;
+ else
+ suggested_action = wxDragNone;
+ }
+
+ return suggested_action;