X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/99ba739f6ab3c688ded3e8a4be4d4f9fccf03520..83a5b533e2fbce8e272ff1c91310ad415ad00b97:/src/gtk/app.cpp diff --git a/src/gtk/app.cpp b/src/gtk/app.cpp index 5db09e1359..e29797d061 100644 --- a/src/gtk/app.cpp +++ b/src/gtk/app.cpp @@ -82,6 +82,14 @@ void wxExit() bool wxYield() { +#if wxUSE_THREADS + if ( !wxThread::IsMain() ) + { + // can't call gtk_main_iteration() from other threads like this + return TRUE; + } +#endif // wxUSE_THREADS + #ifdef __WXDEBUG__ static bool s_inYield = FALSE; @@ -182,9 +190,6 @@ gint wxapp_idle_callback( gpointer WXUNUSED(data) ) // thread so we must lock it here ourselves gdk_threads_enter(); - // Sent idle event to all who request them - while (wxTheApp->ProcessIdle()) { } - /* 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 @@ -193,6 +198,9 @@ gint wxapp_idle_callback( gpointer WXUNUSED(data) ) g_isIdle = TRUE; wxTheApp->m_idleTag = 0; + // Sent idle event to all who request them + while (wxTheApp->ProcessIdle()) { } + // Release lock again gdk_threads_leave(); @@ -630,11 +638,14 @@ int wxEntryStart( int argc, char *argv[] ) gtk_set_locale(); + // We should have the wxUSE_WCHAR_T test on the _outside_ +#if wxUSE_WCHAR_T #if defined(__WXGTK20__) // gtk+ 2.0 supports Unicode through UTF-8 strings wxConvCurrent = &wxConvUTF8; -#elif wxUSE_WCHAR_T +#else if (!wxOKlibc()) wxConvCurrent = &wxConvLocal; +#endif #else if (!wxOKlibc()) wxConvCurrent = (wxMBConv*) NULL; #endif @@ -654,7 +665,6 @@ int wxEntryStart( int argc, char *argv[] ) return 0; } - int wxEntryInitGui() { int retValue = 0;