Don't send idle events while an assertion dialog is showing.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22800 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -61,6 +61,16 @@ public:
|
|||||||
|
|
||||||
virtual bool OnInit();
|
virtual bool OnInit();
|
||||||
virtual bool OnInitGui();
|
virtual bool OnInitGui();
|
||||||
|
|
||||||
|
#ifdef __WXDEBUG__
|
||||||
|
virtual void OnAssert(const wxChar *file, int line, const wxChar *cond, const wxChar *msg);
|
||||||
|
bool IsInAssert() const { return m_isInAssert; }
|
||||||
|
#endif // __WXDEBUG__
|
||||||
|
|
||||||
|
private:
|
||||||
|
#ifdef __WXDEBUG__
|
||||||
|
bool m_isInAssert;
|
||||||
|
#endif // __WXDEBUG__
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _WX_COCOA_APP_H_
|
#endif // _WX_COCOA_APP_H_
|
||||||
|
@@ -64,6 +64,14 @@ wxPoseAsInitializer *wxPoseAsInitializer::sm_first = NULL;
|
|||||||
{
|
{
|
||||||
wxASSERT(wxTheApp);
|
wxASSERT(wxTheApp);
|
||||||
wxLogDebug("doIdle called");
|
wxLogDebug("doIdle called");
|
||||||
|
#ifdef __WXDEBUG__
|
||||||
|
if(wxTheApp->IsInAssert())
|
||||||
|
{
|
||||||
|
wxLogDebug("Idle events ignored durring assertion dialog");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
NSRunLoop *rl = [NSRunLoop currentRunLoop];
|
NSRunLoop *rl = [NSRunLoop currentRunLoop];
|
||||||
// runMode: beforeDate returns YES if something was done
|
// runMode: beforeDate returns YES if something was done
|
||||||
while(wxTheApp->ProcessIdle()) // FIXME: AND NO EVENTS ARE PENDING
|
while(wxTheApp->ProcessIdle()) // FIXME: AND NO EVENTS ARE PENDING
|
||||||
@@ -77,6 +85,7 @@ wxPoseAsInitializer *wxPoseAsInitializer::sm_first = NULL;
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
}
|
||||||
wxLogDebug("Idle processing complete, requesting next idle event");
|
wxLogDebug("Idle processing complete, requesting next idle event");
|
||||||
// Add ourself back into the run loop (on next event) if necessary
|
// Add ourself back into the run loop (on next event) if necessary
|
||||||
wxTheApp->CocoaRequestIdle();
|
wxTheApp->CocoaRequestIdle();
|
||||||
@@ -175,6 +184,10 @@ wxApp::wxApp()
|
|||||||
#if WXWIN_COMPATIBILITY_2_2
|
#if WXWIN_COMPATIBILITY_2_2
|
||||||
m_wantDebugOutput = TRUE;
|
m_wantDebugOutput = TRUE;
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef __WXDEBUG__
|
||||||
|
m_isInAssert = FALSE;
|
||||||
|
#endif // __WXDEBUG__
|
||||||
|
|
||||||
|
|
||||||
argc = 0;
|
argc = 0;
|
||||||
argv = NULL;
|
argv = NULL;
|
||||||
@@ -309,3 +322,12 @@ bool wxApp::Yield(bool onlyIfNeeded)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __WXDEBUG__
|
||||||
|
void wxApp::OnAssert(const wxChar *file, int line, const wxChar* cond, const wxChar *msg)
|
||||||
|
{
|
||||||
|
m_isInAssert = TRUE;
|
||||||
|
wxAppBase::OnAssert(file, line, cond, msg);
|
||||||
|
m_isInAssert = FALSE;
|
||||||
|
}
|
||||||
|
#endif // __WXDEBUG__
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user