From b4e0cd2a783837588508559596b4aa5a2f2aad61 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Sun, 21 May 2000 13:20:33 +0000 Subject: [PATCH] Tried to fix problem with events being blocked in the drop *target* by the global block from the drop source. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7447 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/dnd.cpp | 12 ++++++++++++ src/gtk1/dnd.cpp | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/gtk/dnd.cpp b/src/gtk/dnd.cpp index 8a22b26a2a..f979fe5ee2 100644 --- a/src/gtk/dnd.cpp +++ b/src/gtk/dnd.cpp @@ -117,7 +117,10 @@ static void target_drag_leave( GtkWidget *WXUNUSED(widget), /* we don't need return values. this event is just for information */ + bool tmp = g_blockEventsOnDrag; + g_blockEventsOnDrag = FALSE; drop_target->OnLeave(); + g_blockEventsOnDrag = tmp; /* this has to be done because GDK has no "drag_enter" event */ drop_target->m_firstMotion = TRUE; @@ -156,12 +159,18 @@ static gboolean target_drag_motion( GtkWidget *WXUNUSED(widget), if (drop_target->m_firstMotion) { /* the first "drag_motion" event substitutes a "drag_enter" event */ + bool tmp = g_blockEventsOnDrag; + g_blockEventsOnDrag = FALSE; result = drop_target->OnEnter( x, y, result ); + g_blockEventsOnDrag = tmp; } else { /* give program a chance to react (i.e. to say no by returning FALSE) */ + bool tmp = g_blockEventsOnDrag; + g_blockEventsOnDrag = FALSE; result = drop_target->OnDragOver( x, y, result ); + g_blockEventsOnDrag = tmp; } bool ret = wxIsDragResultOk( result ); @@ -226,7 +235,10 @@ static gboolean target_drag_drop( GtkWidget *widget, if (context->suggested_action == GDK_ACTION_COPY) result = wxDragCopy; */ + bool tmp = g_blockEventsOnDrag; + g_blockEventsOnDrag = FALSE; bool ret = drop_target->OnDrop( x, y ); + g_blockEventsOnDrag = tmp; if (!ret) { diff --git a/src/gtk1/dnd.cpp b/src/gtk1/dnd.cpp index 8a22b26a2a..f979fe5ee2 100644 --- a/src/gtk1/dnd.cpp +++ b/src/gtk1/dnd.cpp @@ -117,7 +117,10 @@ static void target_drag_leave( GtkWidget *WXUNUSED(widget), /* we don't need return values. this event is just for information */ + bool tmp = g_blockEventsOnDrag; + g_blockEventsOnDrag = FALSE; drop_target->OnLeave(); + g_blockEventsOnDrag = tmp; /* this has to be done because GDK has no "drag_enter" event */ drop_target->m_firstMotion = TRUE; @@ -156,12 +159,18 @@ static gboolean target_drag_motion( GtkWidget *WXUNUSED(widget), if (drop_target->m_firstMotion) { /* the first "drag_motion" event substitutes a "drag_enter" event */ + bool tmp = g_blockEventsOnDrag; + g_blockEventsOnDrag = FALSE; result = drop_target->OnEnter( x, y, result ); + g_blockEventsOnDrag = tmp; } else { /* give program a chance to react (i.e. to say no by returning FALSE) */ + bool tmp = g_blockEventsOnDrag; + g_blockEventsOnDrag = FALSE; result = drop_target->OnDragOver( x, y, result ); + g_blockEventsOnDrag = tmp; } bool ret = wxIsDragResultOk( result ); @@ -226,7 +235,10 @@ static gboolean target_drag_drop( GtkWidget *widget, if (context->suggested_action == GDK_ACTION_COPY) result = wxDragCopy; */ + bool tmp = g_blockEventsOnDrag; + g_blockEventsOnDrag = FALSE; bool ret = drop_target->OnDrop( x, y ); + g_blockEventsOnDrag = tmp; if (!ret) {