not called from main thread
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20583
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
// wxWakeUpIdle
//-----------------------------------------------------------------------------
+static bool gs_WakeUpIdle = false;
+
void wxWakeUpIdle()
{
#if wxUSE_THREADS
wxMutexGuiEnter();
#endif
- if (g_isIdle)
+ if (g_isIdle) {
+ gs_WakeUpIdle = true;
wxapp_install_idle_handler();
+ gs_WakeUpIdle = false;
+ }
#if wxUSE_THREADS
if (!wxThread::IsMain())
void wxapp_install_idle_handler()
{
+ wxASSERT_MSG( wxThread::IsMain() || gs_WakeUpIdle, wxT("attempt to install idle handler from widget callback in child thread (should be exclusively from wxWakeUpIdle)") );
+
wxASSERT_MSG( wxTheApp->m_idleTag == 0, wxT("attempt to install idle handler twice") );
g_isIdle = FALSE;
// wxWakeUpIdle
//-----------------------------------------------------------------------------
+static bool gs_WakeUpIdle = false;
+
void wxWakeUpIdle()
{
#if wxUSE_THREADS
wxMutexGuiEnter();
#endif
- if (g_isIdle)
+ if (g_isIdle) {
+ gs_WakeUpIdle = true;
wxapp_install_idle_handler();
+ gs_WakeUpIdle = false;
+ }
#if wxUSE_THREADS
if (!wxThread::IsMain())
void wxapp_install_idle_handler()
{
+ wxASSERT_MSG( wxThread::IsMain() || gs_WakeUpIdle, wxT("attempt to install idle handler from widget callback in child thread (should be exclusively from wxWakeUpIdle)") );
+
wxASSERT_MSG( wxTheApp->m_idleTag == 0, wxT("attempt to install idle handler twice") );
g_isIdle = FALSE;