]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/app.cpp
Send all menu item actions to a dedicated target. This is to ensure
[wxWidgets.git] / src / os2 / app.cpp
index d0c2b5d7ed5f20611fb3638fb01a8e7694eb32fd..84687d9924f211c3e3071568ff013d5eba3de813 100644 (file)
@@ -166,15 +166,13 @@ void wxApp::HandleSockets()
         int i;
         struct GsocketCallbackInfo
           *CallbackInfo = (struct GsocketCallbackInfo *)m_sockCallbackInfo;
-        int r = 0;
         timeout.tv_sec = 0;
         timeout.tv_usec = 0;
         if ( select(m_maxSocketNr, &readfds, &writefds, 0, &timeout) > 0)
         {
-            for (i = m_lastUsedHandle + 1; i != m_lastUsedHandle; i++)
+            for (i = m_lastUsedHandle + 1; i != m_lastUsedHandle;
+                 (i < m_maxSocketNr - 1) ? i++ : (i = 0))
             {
-                if (i == m_maxSocketNr)
-                    i = 0;
                 if (FD_ISSET(i, &readfds))
                 {
                     int r;
@@ -187,7 +185,6 @@ void wxApp::HandleSockets()
                     {
                         CallbackInfo[r].proc(CallbackInfo[r].gsock);
                         pendingEvent = TRUE;
-                        wxYield();
                     }
                 }
                 if (FD_ISSET(i, &writefds))
@@ -201,14 +198,13 @@ void wxApp::HandleSockets()
                     {
                         CallbackInfo[r].proc(CallbackInfo[r].gsock);
                         pendingEvent = TRUE;
-                        wxYield();
                     }
                 }
             }
             m_lastUsedHandle = i;
         }
         if (pendingEvent)
-            wxYield();
+            ProcessPendingEvents();
     }
 }
 // ---------------------------------------------------------------------------
@@ -646,13 +642,13 @@ int wxApp::MainLoop()
         while (!Pending() && ProcessIdle())
         {
             HandleSockets();
-            wxUsleep(10000);
+            wxUsleep(10);
         }
         HandleSockets();
         if (Pending())
             DoMessage();
         else
-            wxUsleep(10000);
+            wxUsleep(10);
 
     }
     return (int)svCurrentMsg.mp1;
@@ -869,6 +865,7 @@ bool wxApp::Yield(bool onlyIfNeeded)
     if (wxTheApp)
         wxTheApp->ProcessPendingEvents();
 
+    HandleSockets();
     //
     // Let the logs be flashed again
     //