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
This commit is contained in:
Robert Roebling
2000-05-21 13:20:33 +00:00
parent cf5d275eb8
commit b4e0cd2a78
2 changed files with 24 additions and 0 deletions

View File

@@ -117,7 +117,10 @@ static void target_drag_leave( GtkWidget *WXUNUSED(widget),
/* we don't need return values. this event is just for /* we don't need return values. this event is just for
information */ information */
bool tmp = g_blockEventsOnDrag;
g_blockEventsOnDrag = FALSE;
drop_target->OnLeave(); drop_target->OnLeave();
g_blockEventsOnDrag = tmp;
/* this has to be done because GDK has no "drag_enter" event */ /* this has to be done because GDK has no "drag_enter" event */
drop_target->m_firstMotion = TRUE; drop_target->m_firstMotion = TRUE;
@@ -156,12 +159,18 @@ static gboolean target_drag_motion( GtkWidget *WXUNUSED(widget),
if (drop_target->m_firstMotion) if (drop_target->m_firstMotion)
{ {
/* the first "drag_motion" event substitutes a "drag_enter" event */ /* the first "drag_motion" event substitutes a "drag_enter" event */
bool tmp = g_blockEventsOnDrag;
g_blockEventsOnDrag = FALSE;
result = drop_target->OnEnter( x, y, result ); result = drop_target->OnEnter( x, y, result );
g_blockEventsOnDrag = tmp;
} }
else else
{ {
/* give program a chance to react (i.e. to say no by returning FALSE) */ /* 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 ); result = drop_target->OnDragOver( x, y, result );
g_blockEventsOnDrag = tmp;
} }
bool ret = wxIsDragResultOk( result ); bool ret = wxIsDragResultOk( result );
@@ -226,7 +235,10 @@ static gboolean target_drag_drop( GtkWidget *widget,
if (context->suggested_action == GDK_ACTION_COPY) result = wxDragCopy; if (context->suggested_action == GDK_ACTION_COPY) result = wxDragCopy;
*/ */
bool tmp = g_blockEventsOnDrag;
g_blockEventsOnDrag = FALSE;
bool ret = drop_target->OnDrop( x, y ); bool ret = drop_target->OnDrop( x, y );
g_blockEventsOnDrag = tmp;
if (!ret) if (!ret)
{ {

View File

@@ -117,7 +117,10 @@ static void target_drag_leave( GtkWidget *WXUNUSED(widget),
/* we don't need return values. this event is just for /* we don't need return values. this event is just for
information */ information */
bool tmp = g_blockEventsOnDrag;
g_blockEventsOnDrag = FALSE;
drop_target->OnLeave(); drop_target->OnLeave();
g_blockEventsOnDrag = tmp;
/* this has to be done because GDK has no "drag_enter" event */ /* this has to be done because GDK has no "drag_enter" event */
drop_target->m_firstMotion = TRUE; drop_target->m_firstMotion = TRUE;
@@ -156,12 +159,18 @@ static gboolean target_drag_motion( GtkWidget *WXUNUSED(widget),
if (drop_target->m_firstMotion) if (drop_target->m_firstMotion)
{ {
/* the first "drag_motion" event substitutes a "drag_enter" event */ /* the first "drag_motion" event substitutes a "drag_enter" event */
bool tmp = g_blockEventsOnDrag;
g_blockEventsOnDrag = FALSE;
result = drop_target->OnEnter( x, y, result ); result = drop_target->OnEnter( x, y, result );
g_blockEventsOnDrag = tmp;
} }
else else
{ {
/* give program a chance to react (i.e. to say no by returning FALSE) */ /* 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 ); result = drop_target->OnDragOver( x, y, result );
g_blockEventsOnDrag = tmp;
} }
bool ret = wxIsDragResultOk( result ); bool ret = wxIsDragResultOk( result );
@@ -226,7 +235,10 @@ static gboolean target_drag_drop( GtkWidget *widget,
if (context->suggested_action == GDK_ACTION_COPY) result = wxDragCopy; if (context->suggested_action == GDK_ACTION_COPY) result = wxDragCopy;
*/ */
bool tmp = g_blockEventsOnDrag;
g_blockEventsOnDrag = FALSE;
bool ret = drop_target->OnDrop( x, y ); bool ret = drop_target->OnDrop( x, y );
g_blockEventsOnDrag = tmp;
if (!ret) if (!ret)
{ {