X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/eb6fa4b4257897e4e9655b05e4105e8b47f67476..eb65cb341bb04925a8698497e0d2d4a35986f6d4:/src/motif/evtloop.cpp diff --git a/src/motif/evtloop.cpp b/src/motif/evtloop.cpp index 41c575d343..782ceeab07 100644 --- a/src/motif/evtloop.cpp +++ b/src/motif/evtloop.cpp @@ -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],