From: Robert Roebling Date: Sun, 16 Jan 2005 15:33:28 +0000 (+0000) Subject: Applied patch for correct feedback from DND X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/c7d94ca4f9246b9d0b9b6772adbea8bcb17fc076 Applied patch for correct feedback from DND actions (not all actions are allowed). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31394 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/gtk/dnd.cpp b/src/gtk/dnd.cpp index bacea138e7..02701c7a54 100644 --- a/src/gtk/dnd.cpp +++ b/src/gtk/dnd.cpp @@ -220,7 +220,9 @@ static gboolean target_drag_motion( GtkWidget *WXUNUSED(widget), if (ret) { GdkDragAction action; - if (result == wxDragCopy) + if ((result == wxDragCopy) && (context->actions & GDK_ACTION_COPY) || + (result == wxDragMove) && !(context->actions & GDK_ACTION_MOVE) || + (result == wxDragLink) && !(context->actions & GDK_ACTION_LINK)) action = GDK_ACTION_COPY; else if (result == wxDragLink) action = GDK_ACTION_LINK; @@ -371,7 +373,7 @@ static void target_drag_data_received( GtkWidget *WXUNUSED(widget), this is only valid for the duration of this call */ drop_target->SetDragData( data ); - wxDragResult result = ConvertFromGTK(context->suggested_action); + wxDragResult result = ConvertFromGTK(context->action); if ( wxIsDragResultOk( drop_target->OnData( x, y, result ) ) ) { diff --git a/src/gtk1/dnd.cpp b/src/gtk1/dnd.cpp index bacea138e7..02701c7a54 100644 --- a/src/gtk1/dnd.cpp +++ b/src/gtk1/dnd.cpp @@ -220,7 +220,9 @@ static gboolean target_drag_motion( GtkWidget *WXUNUSED(widget), if (ret) { GdkDragAction action; - if (result == wxDragCopy) + if ((result == wxDragCopy) && (context->actions & GDK_ACTION_COPY) || + (result == wxDragMove) && !(context->actions & GDK_ACTION_MOVE) || + (result == wxDragLink) && !(context->actions & GDK_ACTION_LINK)) action = GDK_ACTION_COPY; else if (result == wxDragLink) action = GDK_ACTION_LINK; @@ -371,7 +373,7 @@ static void target_drag_data_received( GtkWidget *WXUNUSED(widget), this is only valid for the duration of this call */ drop_target->SetDragData( data ); - wxDragResult result = ConvertFromGTK(context->suggested_action); + wxDragResult result = ConvertFromGTK(context->action); if ( wxIsDragResultOk( drop_target->OnData( x, y, result ) ) ) {