]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/evtloop.cpp
I admit I have no good solution for wxPrinter::Setup(wxWindow*)
[wxWidgets.git] / src / gtk / evtloop.cpp
index acca1472fe639a9c0f136529e9c88e2f9216232c..429de81069e6bd914732d7ca953110be39acd528 100644 (file)
     #pragma hdrstop
 #endif
 
-#ifndef WX_PRECOMP
-#endif //WX_PRECOMP
-
 #include "wx/evtloop.h"
+#include "wx/app.h"
 
 #include <gtk/gtk.h>
 
@@ -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()