X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e1bf3ad3e8f34361824a801008d47833ac71dcb1..cb0b7b7d811356f729315fc14c7e0d311f43384d:/src/gtk1/evtloop.cpp diff --git a/src/gtk1/evtloop.cpp b/src/gtk1/evtloop.cpp index d89a31d44f..d684ccb0eb 100644 --- a/src/gtk1/evtloop.cpp +++ b/src/gtk1/evtloop.cpp @@ -17,10 +17,6 @@ // headers // ---------------------------------------------------------------------------- -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "evtloop.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -60,8 +56,6 @@ private: // wxEventLoop running and exiting // ---------------------------------------------------------------------------- -wxEventLoop *wxEventLoopBase::ms_activeLoop = NULL; - wxEventLoop::~wxEventLoop() { wxASSERT_MSG( !m_impl, _T("should have been deleted in Run()") ); @@ -72,8 +66,7 @@ int wxEventLoop::Run() // event loops are not recursive, you need to create another loop! wxCHECK_MSG( !IsRunning(), -1, _T("can't reenter a message loop") ); - wxEventLoop *oldLoop = ms_activeLoop; - ms_activeLoop = this; + wxEventLoopActivator activate(this); m_impl = new wxEventLoopImpl; @@ -83,8 +76,6 @@ int wxEventLoop::Run() delete m_impl; m_impl = NULL; - ms_activeLoop = oldLoop; - return exitcode; } @@ -101,17 +92,13 @@ void wxEventLoop::Exit(int rc) // wxEventLoop message processing dispatching // ---------------------------------------------------------------------------- -extern bool g_isIdle; - bool wxEventLoop::Pending() const { - if (wxTheApp && !g_isIdle) + if (wxTheApp) { // We need to remove idle callbacks or gtk_events_pending will // never return false. - gtk_idle_remove( wxTheApp->m_idleTag ); - wxTheApp->m_idleTag = 0; - g_isIdle = TRUE; + wxTheApp->RemoveIdleTag(); } return gtk_events_pending();