X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6c0e8b4ea5699207befbf692301e12b24bd3409c..64621b078d4f6966c98002ef062d1d5f1565271b:/src/msw/evtloop.cpp diff --git a/src/msw/evtloop.cpp b/src/msw/evtloop.cpp index 8c9f562a33..94874f5da1 100644 --- a/src/msw/evtloop.cpp +++ b/src/msw/evtloop.cpp @@ -6,7 +6,7 @@ // Created: 01.06.01 // RCS-ID: $Id$ // Copyright: (c) 2001 Vadim Zeitlin -// License: wxWindows license +// License: wxWindows licence /////////////////////////////////////////////////////////////////////////////// // ============================================================================ @@ -17,7 +17,7 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "evtloop.h" #endif @@ -137,15 +137,15 @@ bool wxEventLoopImpl::PreProcessMessage(MSG *msg) bool wxEventLoopImpl::SendIdleMessage() { - wxIdleEvent event; - - return wxTheApp->ProcessEvent(event) && event.MoreRequested(); + return wxTheApp->ProcessIdle(); } // ============================================================================ // wxEventLoop implementation // ============================================================================ +wxEventLoop *wxEventLoop::ms_activeLoop = NULL; + // ---------------------------------------------------------------------------- // wxEventLoop running and exiting // ---------------------------------------------------------------------------- @@ -166,6 +166,9 @@ int wxEventLoop::Run() wxCHECK_MSG( !IsRunning(), -1, _T("can't reenter a message loop") ); m_impl = new wxEventLoopImpl; + + wxEventLoop *oldLoop = ms_activeLoop; + ms_activeLoop = this; for ( ;; ) { @@ -191,6 +194,8 @@ int wxEventLoop::Run() delete m_impl; m_impl = NULL; + ms_activeLoop = oldLoop; + return exitcode; }