From 14eb37a05eb3741f4c8d9e64b7af45480706cb15 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 2 Jan 2009 22:18:10 +0000 Subject: [PATCH] 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 --- include/wx/msw/evtloop.h | 3 --- src/common/appbase.cpp | 3 +++ src/common/appcmn.cpp | 11 ++++------- src/msw/evtloop.cpp | 6 ------ src/unix/evtloopunix.cpp | 2 -- 5 files changed, 7 insertions(+), 18 deletions(-) diff --git a/include/wx/msw/evtloop.h b/include/wx/msw/evtloop.h index 88ab13492b..2869b07a92 100644 --- a/include/wx/msw/evtloop.h +++ b/include/wx/msw/evtloop.h @@ -102,9 +102,6 @@ public: // MSW-specific function to process a single message virtual void ProcessMessage(WXMSG *msg); - -protected: - virtual void OnNextIteration(); }; #endif // wxUSE_CONSOLE_EVENTLOOP diff --git a/src/common/appbase.cpp b/src/common/appbase.cpp index a02e091ff1..b2a0fd718f 100644 --- a/src/common/appbase.cpp +++ b/src/common/appbase.cpp @@ -385,6 +385,9 @@ void wxAppConsoleBase::WakeUpIdle() bool wxAppConsoleBase::ProcessIdle() { + // process pending wx events before sending idle events + ProcessPendingEvents(); + wxIdleEvent event; event.SetEventObject(this); diff --git a/src/common/appcmn.cpp b/src/common/appcmn.cpp index a38f84583f..af5a1d8ece 100644 --- a/src/common/appcmn.cpp +++ b/src/common/appcmn.cpp @@ -353,11 +353,11 @@ void wxAppBase::DeletePendingObjects() // Returns true if more time is needed. bool wxAppBase::ProcessIdle() { - // process pending wx events before sending idle events - ProcessPendingEvents(); - + // call the base class version first, it will process the pending events + // (which should be done before the idle events generation) and send the + // idle event to wxTheApp itself + bool needMore = wxAppConsoleBase::ProcessIdle(); wxIdleEvent event; - bool needMore = false; wxWindowList::compatibility_iterator node = wxTopLevelWindows.GetFirst(); while (node) { @@ -367,9 +367,6 @@ bool wxAppBase::ProcessIdle() node = node->GetNext(); } - if (wxAppConsole::ProcessIdle()) - needMore = true; - // 'Garbage' collection of windows deleted with Close(). DeletePendingObjects(); diff --git a/src/msw/evtloop.cpp b/src/msw/evtloop.cpp index 0b5530ff70..d09faae69f 100644 --- a/src/msw/evtloop.cpp +++ b/src/msw/evtloop.cpp @@ -363,12 +363,6 @@ void wxGUIEventLoop::WakeUp() #if wxUSE_CONSOLE_EVENTLOOP -void wxConsoleEventLoop::OnNextIteration() -{ - if ( wxTheApp ) - wxTheApp->ProcessPendingEvents(); -} - void wxConsoleEventLoop::WakeUp() { #if wxUSE_THREADS diff --git a/src/unix/evtloopunix.cpp b/src/unix/evtloopunix.cpp index 7f27c1c2a2..1d5c1dc1a0 100644 --- a/src/unix/evtloopunix.cpp +++ b/src/unix/evtloopunix.cpp @@ -174,8 +174,6 @@ int wxConsoleEventLoop::DispatchTimeout(unsigned long timeout) hadEvent = true; #endif // wxUSE_TIMER - wxTheApp->ProcessPendingEvents(); - return hadEvent ? 1 : -1; } -- 2.49.0