- /* indicate that we are now in idle mode - even so deeply
- in idle mode that we don't get any idle events anymore.
- this is like wxMSW where an idle event is sent only
- once each time after the event queue has been completely
- emptied */
+ // When getting called from GDK's time-out handler
+ // we are no longer within GDK's grab on the GUI
+ // thread so we must lock it here ourselves.
+ gdk_threads_enter();
+
+ // Sent idle event to all who request them.
+ wxTheApp->ProcessPendingEvents();
+
+ g_pendingTag = 0;
+
+ // Flush the logged messages if any.
+#if wxUSE_LOG
+ wxLog::FlushActive();
+#endif // wxUSE_LOG
+
+ // Release lock again
+ gdk_threads_leave();
+
+ // Return FALSE to indicate that no more idle events are
+ // to be sent (single shot instead of continuous stream)
+ return FALSE;
+}
+
+static gint wxapp_idle_callback( gpointer WXUNUSED(data) )
+{
+ if (!wxTheApp)
+ return TRUE;
+
+#ifdef __WXDEBUG__
+ // don't generate the idle events while the assert modal dialog is shown,
+ // this completely confuses the apps which don't expect to be reentered
+ // from some safely-looking functions
+ if ( wxTheApp->IsInAssert() )
+ {
+ // But repaint the assertion message if necessary
+ if (wxTopLevelWindows.GetCount() > 0)
+ {
+ wxWindow* win = (wxWindow*) wxTopLevelWindows.Last()->Data();
+ if (win->IsKindOf(CLASSINFO(wxGenericMessageDialog)))
+ win->OnInternalIdle();
+ }
+ return TRUE;
+ }
+#endif // __WXDEBUG__
+
+ // When getting called from GDK's time-out handler
+ // we are no longer within GDK's grab on the GUI
+ // thread so we must lock it here ourselves.
+ gdk_threads_enter();
+
+ // Indicate that we are now in idle mode and event handlers
+ // will have to reinstall the idle handler again.