X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/158949492d68bd0e98fab14dabcc3fa6f6924a6d..8d5ff32d33ad07acb9c1824368fbbe954b601bbb:/src/gtk/app.cpp diff --git a/src/gtk/app.cpp b/src/gtk/app.cpp index c3e76d4158..9f3abf88b9 100644 --- a/src/gtk/app.cpp +++ b/src/gtk/app.cpp @@ -249,17 +249,18 @@ static gint wxapp_idle_callback( gpointer WXUNUSED(data) ) wxTheApp->m_idleTag = 0; } + bool moreIdles = false; + // Send idle event to all who request them as long as // no events have popped up in the event queue. - while (wxTheApp->ProcessIdle() && (gtk_events_pending() == 0)) + while (moreIdles = wxTheApp->ProcessIdle() && (gtk_events_pending() == 0)) ; // 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; + // Return FALSE if no more idle events are to be sent + return moreIdles; } #if wxUSE_THREADS @@ -374,14 +375,14 @@ void wxapp_install_idle_handler() g_isIdle = FALSE; if (g_pendingTag == 0) - g_pendingTag = gtk_idle_add_priority( 900, wxapp_pending_callback, (gpointer) NULL ); + g_pendingTag = g_idle_add_full( 900, wxapp_pending_callback, NULL, NULL ); // This routine gets called by all event handlers // indicating that the idle is over. It may also // get called from other thread for sending events // to the main thread (and processing these in // idle time). Very low priority. - wxTheApp->m_idleTag = gtk_idle_add_priority( 1000, wxapp_idle_callback, (gpointer) NULL ); + wxTheApp->m_idleTag = g_idle_add_full( 1000, wxapp_idle_callback, NULL, NULL ); } //----------------------------------------------------------------------------- @@ -431,9 +432,11 @@ wxApp::wxApp() wxApp::~wxApp() { - if (m_idleTag) gtk_idle_remove( m_idleTag ); + if (m_idleTag) + g_source_remove( m_idleTag ); - if (m_colorCube) free(m_colorCube); + if (m_colorCube) + free(m_colorCube); } bool wxApp::OnInitGui() @@ -695,7 +698,7 @@ void wxApp::RemoveIdleTag() #endif if (!g_isIdle) { - gtk_idle_remove( wxTheApp->m_idleTag ); + g_source_remove( wxTheApp->m_idleTag ); wxTheApp->m_idleTag = 0; g_isIdle = TRUE; }