I hope dnd won't crash anymore and I didn't

break too much else.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@8053 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2000-08-12 16:19:04 +00:00
parent 3193682a45
commit a2d51707f9
4 changed files with 42 additions and 4 deletions

View File

@@ -186,8 +186,14 @@ void wxapp_install_idle_handler()
#if wxUSE_THREADS
static int g_threadUninstallLevel = 0;
void wxapp_install_thread_wakeup()
{
g_threadUninstallLevel++;
if (g_threadUninstallLevel != 1) return;
if (wxTheApp->m_wakeUpTimerTag) return;
wxTheApp->m_wakeUpTimerTag = gtk_timeout_add( 50, wxapp_wakeup_timerout_callback, (gpointer) NULL );
@@ -195,6 +201,10 @@ void wxapp_install_thread_wakeup()
void wxapp_uninstall_thread_wakeup()
{
g_threadUninstallLevel--;
if (g_threadUninstallLevel != 0) return;
if (!wxTheApp->m_wakeUpTimerTag) return;
gtk_timeout_remove( wxTheApp->m_wakeUpTimerTag );

View File

@@ -226,6 +226,11 @@ static gboolean target_drag_drop( GtkWidget *widget,
if (context->suggested_action == GDK_ACTION_COPY) result = wxDragCopy;
*/
/* reset the block here as someone might very well
show a dialog as a reaction to a drop and this
wouldn't work without events */
g_blockEventsOnDrag = FALSE;
bool ret = drop_target->OnDrop( x, y );
if (!ret)
@@ -736,8 +741,12 @@ wxDragResult wxDropSource::DoDragDrop( bool allowMove )
if (m_data->GetFormatCount() == 0)
return (wxDragResult) wxDragNone;
// still in drag
if (g_blockEventsOnDrag)
return (wxDragResult) wxDragNone;
// disabled for now
g_blockEventsOnDrag = FALSE;
g_blockEventsOnDrag = TRUE;
RegisterWindow();
@@ -806,7 +815,7 @@ wxDragResult wxDropSource::DoDragDrop( bool allowMove )
#endif
g_blockEventsOnDrag = FALSE;
UnregisterWindow();
return m_retValue;

View File

@@ -186,8 +186,14 @@ void wxapp_install_idle_handler()
#if wxUSE_THREADS
static int g_threadUninstallLevel = 0;
void wxapp_install_thread_wakeup()
{
g_threadUninstallLevel++;
if (g_threadUninstallLevel != 1) return;
if (wxTheApp->m_wakeUpTimerTag) return;
wxTheApp->m_wakeUpTimerTag = gtk_timeout_add( 50, wxapp_wakeup_timerout_callback, (gpointer) NULL );
@@ -195,6 +201,10 @@ void wxapp_install_thread_wakeup()
void wxapp_uninstall_thread_wakeup()
{
g_threadUninstallLevel--;
if (g_threadUninstallLevel != 0) return;
if (!wxTheApp->m_wakeUpTimerTag) return;
gtk_timeout_remove( wxTheApp->m_wakeUpTimerTag );

View File

@@ -226,6 +226,11 @@ static gboolean target_drag_drop( GtkWidget *widget,
if (context->suggested_action == GDK_ACTION_COPY) result = wxDragCopy;
*/
/* reset the block here as someone might very well
show a dialog as a reaction to a drop and this
wouldn't work without events */
g_blockEventsOnDrag = FALSE;
bool ret = drop_target->OnDrop( x, y );
if (!ret)
@@ -736,8 +741,12 @@ wxDragResult wxDropSource::DoDragDrop( bool allowMove )
if (m_data->GetFormatCount() == 0)
return (wxDragResult) wxDragNone;
// still in drag
if (g_blockEventsOnDrag)
return (wxDragResult) wxDragNone;
// disabled for now
g_blockEventsOnDrag = FALSE;
g_blockEventsOnDrag = TRUE;
RegisterWindow();
@@ -806,7 +815,7 @@ wxDragResult wxDropSource::DoDragDrop( bool allowMove )
#endif
g_blockEventsOnDrag = FALSE;
UnregisterWindow();
return m_retValue;