call ProcessPendingEvents() from wxAppConsoleBase::ProcessIdle() too, not only from wxAppBase::ProcessIdle(); do not call it from wxConsoleEventLoop::Dispatch() as this results in unwanted reentrancies in the socket code when using it
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57799 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -102,9 +102,6 @@ public:
|
|||||||
|
|
||||||
// MSW-specific function to process a single message
|
// MSW-specific function to process a single message
|
||||||
virtual void ProcessMessage(WXMSG *msg);
|
virtual void ProcessMessage(WXMSG *msg);
|
||||||
|
|
||||||
protected:
|
|
||||||
virtual void OnNextIteration();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // wxUSE_CONSOLE_EVENTLOOP
|
#endif // wxUSE_CONSOLE_EVENTLOOP
|
||||||
|
@@ -385,6 +385,9 @@ void wxAppConsoleBase::WakeUpIdle()
|
|||||||
|
|
||||||
bool wxAppConsoleBase::ProcessIdle()
|
bool wxAppConsoleBase::ProcessIdle()
|
||||||
{
|
{
|
||||||
|
// process pending wx events before sending idle events
|
||||||
|
ProcessPendingEvents();
|
||||||
|
|
||||||
wxIdleEvent event;
|
wxIdleEvent event;
|
||||||
|
|
||||||
event.SetEventObject(this);
|
event.SetEventObject(this);
|
||||||
|
@@ -353,11 +353,11 @@ void wxAppBase::DeletePendingObjects()
|
|||||||
// Returns true if more time is needed.
|
// Returns true if more time is needed.
|
||||||
bool wxAppBase::ProcessIdle()
|
bool wxAppBase::ProcessIdle()
|
||||||
{
|
{
|
||||||
// process pending wx events before sending idle events
|
// call the base class version first, it will process the pending events
|
||||||
ProcessPendingEvents();
|
// (which should be done before the idle events generation) and send the
|
||||||
|
// idle event to wxTheApp itself
|
||||||
|
bool needMore = wxAppConsoleBase::ProcessIdle();
|
||||||
wxIdleEvent event;
|
wxIdleEvent event;
|
||||||
bool needMore = false;
|
|
||||||
wxWindowList::compatibility_iterator node = wxTopLevelWindows.GetFirst();
|
wxWindowList::compatibility_iterator node = wxTopLevelWindows.GetFirst();
|
||||||
while (node)
|
while (node)
|
||||||
{
|
{
|
||||||
@@ -367,9 +367,6 @@ bool wxAppBase::ProcessIdle()
|
|||||||
node = node->GetNext();
|
node = node->GetNext();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wxAppConsole::ProcessIdle())
|
|
||||||
needMore = true;
|
|
||||||
|
|
||||||
// 'Garbage' collection of windows deleted with Close().
|
// 'Garbage' collection of windows deleted with Close().
|
||||||
DeletePendingObjects();
|
DeletePendingObjects();
|
||||||
|
|
||||||
|
@@ -363,12 +363,6 @@ void wxGUIEventLoop::WakeUp()
|
|||||||
|
|
||||||
#if wxUSE_CONSOLE_EVENTLOOP
|
#if wxUSE_CONSOLE_EVENTLOOP
|
||||||
|
|
||||||
void wxConsoleEventLoop::OnNextIteration()
|
|
||||||
{
|
|
||||||
if ( wxTheApp )
|
|
||||||
wxTheApp->ProcessPendingEvents();
|
|
||||||
}
|
|
||||||
|
|
||||||
void wxConsoleEventLoop::WakeUp()
|
void wxConsoleEventLoop::WakeUp()
|
||||||
{
|
{
|
||||||
#if wxUSE_THREADS
|
#if wxUSE_THREADS
|
||||||
|
@@ -174,8 +174,6 @@ int wxConsoleEventLoop::DispatchTimeout(unsigned long timeout)
|
|||||||
hadEvent = true;
|
hadEvent = true;
|
||||||
#endif // wxUSE_TIMER
|
#endif // wxUSE_TIMER
|
||||||
|
|
||||||
wxTheApp->ProcessPendingEvents();
|
|
||||||
|
|
||||||
return hadEvent ? 1 : -1;
|
return hadEvent ? 1 : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user