diff --git a/src/gtk/evtloop.cpp b/src/gtk/evtloop.cpp index 59d0e31c18..4c93056000 100644 --- a/src/gtk/evtloop.cpp +++ b/src/gtk/evtloop.cpp @@ -395,7 +395,12 @@ bool wxGUIEventLoop::YieldFor(long eventsToProcess) // Process all pending events too, this is consistent with wxMSW behaviour // and the behaviour of wxGTK itself in the previous versions. - if ( wxTheApp ) + // + // Notice however that we must not do it if we're asked to process only the + // events of specific kind, as pending events could be of any kind at all + // (ideal would be to have a filtering version of ProcessPendingEvents() + // too but we don't have this right now). + if ( eventsToProcess == wxEVT_CATEGORY_ALL && wxTheApp ) wxTheApp->ProcessPendingEvents(); if (eventsToProcess != wxEVT_CATEGORY_CLIPBOARD) diff --git a/src/msw/evtloop.cpp b/src/msw/evtloop.cpp index 7c861c3fae..f39ebc50b0 100644 --- a/src/msw/evtloop.cpp +++ b/src/msw/evtloop.cpp @@ -435,7 +435,7 @@ bool wxGUIEventLoop::YieldFor(long eventsToProcess) } // if there are pending events, we must process them. - if (wxTheApp) + if ( eventsToProcess == wxEVT_CATEGORY_ALL && wxTheApp ) wxTheApp->ProcessPendingEvents(); // put back unprocessed events in the queue diff --git a/src/os2/evtloop.cpp b/src/os2/evtloop.cpp index 0267057888..1ab8cb8fca 100644 --- a/src/os2/evtloop.cpp +++ b/src/os2/evtloop.cpp @@ -400,7 +400,7 @@ bool wxGUIEventLoop::YieldFor(long eventsToProcess) // // If they are pending events, we must process them. // - if (wxTheApp) + if (eventsToProcess == wxEVT_CATEGORY_ALL && wxTheApp) { wxTheApp->ProcessPendingEvents(); wxTheApp->HandleSockets(); diff --git a/src/osx/core/evtloop_cf.cpp b/src/osx/core/evtloop_cf.cpp index 7e70dec8b1..4718fa7ae8 100644 --- a/src/osx/core/evtloop_cf.cpp +++ b/src/osx/core/evtloop_cf.cpp @@ -214,7 +214,7 @@ bool wxCFEventLoop::YieldFor(long eventsToProcess) while ( ProcessIdle() ) {} // if there are pending events, we must process them. - if (wxTheApp) + if ( eventsToProcess == wxEVT_CATEGORY_ALL && wxTheApp ) wxTheApp->ProcessPendingEvents(); #if wxUSE_LOG