]> git.saurik.com Git - wxWidgets.git/blobdiff - src/x11/evtloop.cpp
Updated build files.
[wxWidgets.git] / src / x11 / evtloop.cpp
index de6b1f8b83c14aa6a2ac295f3f1e16a36b35f0cf..ce563c84999d013e35bbfbe20605052566ac1998 100644 (file)
 #ifndef WX_PRECOMP
     #include "wx/hash.h"
     #include "wx/app.h"
+    #include "wx/window.h"
+    #include "wx/timer.h"
+    #include "wx/module.h"
 #endif
 
-#include "wx/window.h"
 #include "wx/tooltip.h"
-#include "wx/timer.h"
-#include "wx/module.h"
 #include "wx/unix/private.h"
 #include "wx/x11/private.h"
 #include "X11/Xlib.h"
 #include <sys/time.h>
 #include <unistd.h>
 
+#ifdef HAVE_SYS_SELECT_H
+#   include <sys/select.h>
+#endif
+
 #if wxUSE_SOCKETS
 // ----------------------------------------------------------------------------
 // wxSocketTable
@@ -76,7 +80,7 @@ class wxSocketTable: public wxHashTable
     wxSocketTable(): wxHashTable(wxKEY_INTEGER)
     {
     }
-    ~wxSocketTable()
+    virtual ~wxSocketTable()
     {
         WX_CLEAR_HASH_TABLE(*this)
     }
@@ -368,10 +372,6 @@ int wxEventLoop::Run()
     m_impl->m_keepGoing = true;
     while ( m_impl->m_keepGoing )
     {
-#if 0 // wxUSE_THREADS
-        wxMutexGuiLeaveOrEnter();
-#endif // wxUSE_THREADS
-
         // generate and process idle events for as long as we don't have
         // anything else to do
         while ( ! Pending() )
@@ -381,13 +381,6 @@ int wxEventLoop::Run()
 #endif
             if (!m_impl->SendIdleEvent())
             {
-#if 0 // wxUSE_THREADS
-                // leave the main loop to give other threads a chance to
-                // perform their GUI work
-                wxMutexGuiLeave();
-                wxUsleep(20);
-                wxMutexGuiEnter();
-#endif
                 // Break out of while loop
                 break;
             }
@@ -401,6 +394,8 @@ int wxEventLoop::Run()
         }
     }
 
+    OnExit();
+
     int exitcode = m_impl->GetExitCode();
     delete m_impl;
     m_impl = NULL;
@@ -430,6 +425,9 @@ bool wxEventLoop::Dispatch()
 {
     XEvent event;
 
+    // Start off by checking if any of our child processes have finished.
+    wxCheckForFinishedChildren();
+
     // TODO allowing for threads, as per e.g. wxMSW
 
     // This now waits until either an X event is received,