X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/68a9527d5185cdd9d3fef3d9421415c50de8794d..806ad819585655ac1c35427409611d7795d0b910:/src/gtk/evtloop.cpp diff --git a/src/gtk/evtloop.cpp b/src/gtk/evtloop.cpp index 16fa2087f2..25806a312c 100644 --- a/src/gtk/evtloop.cpp +++ b/src/gtk/evtloop.cpp @@ -98,14 +98,14 @@ void wxEventLoop::Exit(int rc) bool wxEventLoop::Pending() const { - if (wxTheApp) - { - // We need to remove idle callbacks or gtk_events_pending will - // never return false. - wxTheApp->SuspendIdleCallback(); - } - - return gtk_events_pending(); + bool pending; + wxApp* app = wxTheApp; + if (app != NULL) + // app->EventsPending() avoids false positives from our idle source + pending = app->EventsPending(); + else + pending = gtk_events_pending() != 0; + return pending; } bool wxEventLoop::Dispatch()