From c7d94ca4f9246b9d0b9b6772adbea8bcb17fc076 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Sun, 16 Jan 2005 15:33:28 +0000 Subject: [PATCH] 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 --- src/gtk/dnd.cpp | 6 ++++-- src/gtk1/dnd.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) 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 ) ) ) { -- 2.45.2