X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3754265e328a7cc7f67a46a9beea105cf1d49a14..9894cc01c98b0d6fa960d57e9a6155bbb07ed67b:/src/gtk1/evtloop.cpp

diff --git a/src/gtk1/evtloop.cpp b/src/gtk1/evtloop.cpp
index acca1472fe..ac59d77edb 100644
--- a/src/gtk1/evtloop.cpp
+++ b/src/gtk1/evtloop.cpp
@@ -28,10 +28,8 @@
     #pragma hdrstop
 #endif
 
-#ifndef WX_PRECOMP
-#endif //WX_PRECOMP
-
 #include "wx/evtloop.h"
+#include "wx/app.h"
 
 #include <gtk/gtk.h>
 
@@ -105,7 +103,14 @@ void wxEventLoop::Exit(int rc)
 
 bool wxEventLoop::Pending() const
 {
-    return gtk_events_pending() > 0;
+    if (wxTheApp)
+    {
+        // We need to remove idle callbacks or gtk_events_pending will
+        // never return false.
+        wxTheApp->RemoveIdleTag();
+    }
+
+    return gtk_events_pending();
 }
 
 bool wxEventLoop::Dispatch()