]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/evtloop.cpp
implement SetTimes() for directories too under MSW (#10250)
[wxWidgets.git] / src / msw / evtloop.cpp
index 7c1ab86c199b2f586a286fc9f41748da42a47877..d09faae69f8a00b25b74cac953c4ed126f114c9c 100644 (file)
@@ -111,22 +111,33 @@ int wxMSWEventLoopBase::GetNextMessageTimeout(WXMSG *msg, unsigned long timeout)
     {
         // we use this function just in order to not block longer than the
         // given timeout, so we don't pass any handles to it at all
-        if ( ::MsgWaitForMultipleObjects
-               (
-                0, NULL,
-                FALSE,
-                timeout,
-                QS_ALLINPUT
-               ) == WAIT_TIMEOUT )
+        DWORD rc = ::MsgWaitForMultipleObjects
+                     (
+                        0, NULL,
+                        FALSE,
+                        timeout,
+                        QS_ALLINPUT
+                     );
+
+        switch ( rc )
         {
-            return -1;
-        }
-
-        if ( !::PeekMessage(msg, 0, 0, 0, PM_REMOVE) )
-        {
-            wxFAIL_MSG( _T("PeekMessage() should have succeeded") );
-
-            return -1;
+            default:
+                wxLogDebug("unexpected MsgWaitForMultipleObjects() return "
+                           "value %lu", rc);
+                // fall through
+
+            case WAIT_TIMEOUT:
+                return -1;
+
+            case WAIT_OBJECT_0:
+                if ( !::PeekMessage(msg, 0, 0, 0, PM_REMOVE) )
+                {
+                    // somehow it may happen that MsgWaitForMultipleObjects()
+                    // returns true but there are no messages -- just treat it
+                    // the same as timeout then
+                    return -1;
+                }
+                break;
         }
     }
 
@@ -352,12 +363,6 @@ void wxGUIEventLoop::WakeUp()
 
 #if wxUSE_CONSOLE_EVENTLOOP
 
-void wxConsoleEventLoop::OnNextIteration()
-{
-    if ( wxTheApp )
-        wxTheApp->ProcessPendingEvents();
-}
-
 void wxConsoleEventLoop::WakeUp()
 {
 #if wxUSE_THREADS