X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c156411a0886a4b49a0c30c36153fb3c1edd4b51..75a937411ce0aa5856b135f2d0f9406ac83e9cce:/src/gtk1/app.cpp diff --git a/src/gtk1/app.cpp b/src/gtk1/app.cpp index c258135bab..86822b5abd 100644 --- a/src/gtk1/app.cpp +++ b/src/gtk1/app.cpp @@ -164,20 +164,31 @@ bool wxApp::Yield(bool onlyIfNeeded) // wxWakeUpIdle //----------------------------------------------------------------------------- +// RR/KH: The wxMutexGui calls are not needed on GTK2 according to +// the GTK faq, http://www.gtk.org/faq/#AEN500 +// The calls to gdk_threads_enter() and leave() are specifically noted +// as not being necessary. The MutexGui calls are still left in for GTK1. +// Eliminating the MutexGui calls fixes the long-standing "random" lockup +// when using wxPostEvent (which calls WakeUpIdle) from a thread. + void wxApp::WakeUpIdle() { +#ifndef __WXGTK20__ #if wxUSE_THREADS if (!wxThread::IsMain()) wxMutexGuiEnter(); -#endif +#endif // wxUSE_THREADS_ +#endif // __WXGTK2__ if (g_isIdle) wxapp_install_idle_handler(); +#ifndef __WXGTK20__ #if wxUSE_THREADS if (!wxThread::IsMain()) wxMutexGuiLeave(); -#endif +#endif // wxUSE_THREADS_ +#endif // __WXGTK2__ } //----------------------------------------------------------------------------- @@ -551,7 +562,7 @@ bool wxApp::Initialize(int& argc, wxChar **argv) (gtk_minor_version == 2) && (gtk_micro_version < 4)) { - printf( "wxWindows warning: GUI threading disabled due to outdated GTK version\n" ); + printf( "wxWidgets warning: GUI threading disabled due to outdated GTK version\n" ); } else { @@ -645,8 +656,6 @@ bool wxApp::Initialize(int& argc, wxChar **argv) wxFont::SetDefaultEncoding(wxLocale::GetSystemEncoding()); #endif - wxGetRootWindow(); - return true; }