X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7e1bcfa80e19ac853b8bc7084075fe3b01e63f03..7c9955d147ed92cdd79d795ed94d6e03fca06a52:/src/motif/evtloop.cpp diff --git a/src/motif/evtloop.cpp b/src/motif/evtloop.cpp index 57a3283542..f5f5e000df 100644 --- a/src/motif/evtloop.cpp +++ b/src/motif/evtloop.cpp @@ -6,7 +6,7 @@ // Created: 01.11.02 // RCS-ID: $Id$ // Copyright: (c) 2002 Mattia Barbon -// License: wxWindows license +// License: wxWindows licence /////////////////////////////////////////////////////////////////////////////// // ============================================================================ @@ -35,6 +35,7 @@ #include "wx/evtloop.h" #include "wx/event.h" #include "wx/app.h" +#include "wx/window.h" #ifdef __VMS__ #pragma message disable nosimpint @@ -168,7 +169,11 @@ bool wxEventLoop::Dispatch() ProcessXEvent( &event ); } else - XtAppProcessEvent( context, XtIMTimer|XtIMAlternateInput|XtIMSignal ); +#ifdef __VMS + XtAppProcessEvent( context, XtIMTimer|XtIMAlternateInput ); +#else + XtAppProcessEvent( context, XtIMTimer|XtIMAlternateInput|XtIMSignal ); +#endif return m_impl ? m_impl->GetKeepGoing() : true; } @@ -341,17 +346,27 @@ bool CheckForKeyUp(XEvent* event) bool wxDoEventLoopIteration( wxEventLoop& evtLoop ) { + bool moreRequested, pendingEvents; + + for(;;) + { + pendingEvents = evtLoop.Pending(); + if( pendingEvents ) break; + moreRequested = ::SendIdleMessage(); + if( !moreRequested ) break; + } + #if wxUSE_THREADS - // leave the main loop to give other threads a chance to - // perform their GUI work - wxMutexGuiLeave(); - wxUsleep(20); - wxMutexGuiEnter(); + if( !pendingEvents && !moreRequested ) + { + // leave the main loop to give other threads a chance to + // perform their GUI work + wxMutexGuiLeave(); + wxUsleep(20); + wxMutexGuiEnter(); + } #endif - while ( !evtLoop.Pending() && ::SendIdleMessage() ) - ; - if( !evtLoop.Dispatch() ) return false; @@ -429,7 +444,7 @@ static void wxInputCallback( XtPointer, int* fd, XtInputId* ) static void wxBreakDispatch() { - char dummy; + char dummy = 0; // for valgrind // check if wxWakeUpIdle has already been called fd_set in;