Fix wxEventLoop so it does not sleep 20 msec between events when threads
are anabled. Now the ode should be equivalent to the 2.4 event loop. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19223 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
b1e343f2bb
commit
369da72455
@ -173,7 +173,7 @@ bool wxEventLoop::Dispatch()
|
||||
#else
|
||||
XtAppProcessEvent( context, XtIMTimer|XtIMAlternateInput|XtIMSignal );
|
||||
#endif
|
||||
|
||||
|
||||
return m_impl ? m_impl->GetKeepGoing() : true;
|
||||
}
|
||||
|
||||
@ -345,16 +345,26 @@ bool CheckForKeyUp(XEvent* event)
|
||||
|
||||
bool wxDoEventLoopIteration( wxEventLoop& evtLoop )
|
||||
{
|
||||
#if wxUSE_THREADS
|
||||
// leave the main loop to give other threads a chance to
|
||||
// perform their GUI work
|
||||
wxMutexGuiLeave();
|
||||
wxUsleep(20);
|
||||
wxMutexGuiEnter();
|
||||
#endif
|
||||
bool moreRequested, pendingEvents;
|
||||
|
||||
while ( !evtLoop.Pending() && ::SendIdleMessage() )
|
||||
;
|
||||
for(;;)
|
||||
{
|
||||
pendingEvents = evtLoop.Pending();
|
||||
if( pendingEvents ) break;
|
||||
moreRequested = ::SendIdleMessage();
|
||||
if( !moreRequested ) break;
|
||||
}
|
||||
|
||||
#if wxUSE_THREADS
|
||||
if( !pendingEvents && !moreRequested )
|
||||
{
|
||||
// leave the main loop to give other threads a chance to
|
||||
// perform their GUI work
|
||||
wxMutexGuiLeave();
|
||||
wxUsleep(20);
|
||||
wxMutexGuiEnter();
|
||||
}
|
||||
#endif
|
||||
|
||||
if( !evtLoop.Dispatch() )
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user