X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3754265e328a7cc7f67a46a9beea105cf1d49a14..04a014a5d69a9345e563b4395768d61fc743b0c3:/src/gtk/evtloop.cpp diff --git a/src/gtk/evtloop.cpp b/src/gtk/evtloop.cpp index acca1472fe..429de81069 100644 --- a/src/gtk/evtloop.cpp +++ b/src/gtk/evtloop.cpp @@ -28,10 +28,8 @@ #pragma hdrstop #endif -#ifndef WX_PRECOMP -#endif //WX_PRECOMP - #include "wx/evtloop.h" +#include "wx/app.h" #include @@ -103,9 +101,19 @@ void wxEventLoop::Exit(int rc) // wxEventLoop message processing dispatching // ---------------------------------------------------------------------------- +extern bool g_isIdle; + bool wxEventLoop::Pending() const { - return gtk_events_pending() > 0; + if (wxTheApp && !g_isIdle) + { + // We need to remove idle callbacks or gtk_events_pending will + // never return false. + wxTheApp->RemoveIdleTag(); + g_isIdle = TRUE; + } + + return gtk_events_pending(); } bool wxEventLoop::Dispatch()