No real changes, just refactor wxEventLoop/wxApp::ProcessIdle().
Old code called wxApp::ProcessIdle() from wxEventLoopManualRun::Run() which called wxEventLoop::ProcessIdle() which called wxApp methods from it. In the new version wxEventLoopManualRun::Run() calls wxEventLoopManualRun::ProcessIdle() which calls wxApp::ProcessIdle() which calls other wxApp methods which seems to make more sense and also allows overriding ProcessIdle() in either wxEventLoopManual or wxApp-derived classes. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61441 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -63,18 +63,7 @@ void wxEventLoopBase::WakeUpIdle()
|
||||
|
||||
bool wxEventLoopBase::ProcessIdle()
|
||||
{
|
||||
if (!wxTheApp)
|
||||
return false;
|
||||
|
||||
// process pending wx events before sending idle events
|
||||
wxTheApp->ProcessPendingEvents();
|
||||
|
||||
// synthetize an idle event and send it to wxApp
|
||||
wxIdleEvent event;
|
||||
event.SetEventObject(wxTheApp);
|
||||
wxTheApp->ProcessEvent(event);
|
||||
|
||||
return event.MoreRequested();
|
||||
return wxTheApp && wxTheApp->ProcessIdle();
|
||||
}
|
||||
|
||||
bool wxEventLoopBase::Yield(bool onlyIfNeeded)
|
||||
@@ -135,7 +124,7 @@ int wxEventLoopManual::Run()
|
||||
|
||||
// generate and process idle events for as long as we don't
|
||||
// have anything else to do
|
||||
while ( !Pending() && (wxTheApp && wxTheApp->ProcessIdle()) )
|
||||
while ( !Pending() && ProcessIdle() )
|
||||
;
|
||||
|
||||
// if the "should exit" flag is set, the loop should terminate
|
||||
|
||||
Reference in New Issue
Block a user