]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/evtloop.cpp
Fixed copyrights, corrected licence spelling
[wxWidgets.git] / src / motif / evtloop.cpp
index 57a3283542554b4d042cb790d90ec89cc114084d..217cbfa0abd6e8c0a63693c767482fee6dcdd588 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     01.11.02
 // RCS-ID:      $Id$
 // Copyright:   (c) 2002 Mattia Barbon
-// License:     wxWindows license
+// License:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
 // ============================================================================
@@ -168,7 +168,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 +345,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;