]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/evtloop.cpp
load wsock32.dll dynamically, so that wxCore has no dependency on it
[wxWidgets.git] / src / motif / evtloop.cpp
index 41c575d343da14d0608bed705a54f2c1f64ae877..782ceeab074bee8180b80a8e4973d26f2d35b67a 100644 (file)
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "evtloop.h"
 #endif
 
@@ -83,9 +83,7 @@ private:
 
 static bool SendIdleMessage()
 {
-    wxIdleEvent event;
-
-    return wxTheApp->ProcessEvent(event) && event.MoreRequested();
+    return wxTheApp->ProcessIdle();
 }
 
 bool wxEventLoopImpl::SendIdleMessage()
@@ -402,9 +400,11 @@ public:
 
     virtual bool OnInit()
     {
+        // Must be done before modules are initialized
+#if 0
         if( pipe(idleFds) != 0 )
             return false;
-
+#endif
         return true;
     }
 
@@ -463,13 +463,23 @@ static void wxBreakDispatch()
     write( idleFds[1], &dummy, 1 );
 }
 
-void wxWakeUpIdle()
+void wxApp::WakeUpIdle()
 {
     ::wxBreakDispatch();
 }
 
+bool wxInitIdleFds()
+{
+    if( pipe(idleFds) != 0 )
+        return false;
+    return true;
+}
+
 bool wxAddIdleCallback()
 {
+    if (!wxInitIdleFds())
+        return false;
+    
     // install input handler for wxWakeUpIdle
     inputId = XtAppAddInput( (XtAppContext) wxTheApp->GetAppContext(),
                              idleFds[0],