process pending wx events before sending idle events

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47229 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Paul Cornett 2007-07-08 05:31:32 +00:00
parent 9ed8b5a7b2
commit 0728199b91
21 changed files with 14 additions and 81 deletions

View File

@ -497,10 +497,6 @@ public:
wxDEPRECATED( bool Initialized() );
#endif // WXWIN_COMPATIBILITY_2_6
// perform standard OnIdle behaviour, ensure that this is always called
void OnIdle(wxIdleEvent& event);
protected:
// delete all objects in wxPendingDelete list
void DeletePendingObjects();

View File

@ -25,7 +25,6 @@ typedef const struct __CFString * CFStringRef;
class WXDLLEXPORT wxApp: public wxAppBase
{
DECLARE_DYNAMIC_CLASS(wxApp)
DECLARE_EVENT_TABLE()
// ------------------------------------------------------------------------
// initialization
// ------------------------------------------------------------------------

View File

@ -41,7 +41,6 @@ private:
wxVideoMode m_videoMode;
DECLARE_DYNAMIC_CLASS(wxApp)
DECLARE_EVENT_TABLE()
};
#endif // _WX_DFB_APP_H_

View File

@ -81,7 +81,6 @@ private:
guint m_idleSourceId;
DECLARE_DYNAMIC_CLASS(wxApp)
DECLARE_EVENT_TABLE()
};
#endif // _WX_GTK_APP_H_

View File

@ -72,7 +72,6 @@ private:
#endif // __WXDEBUG__
DECLARE_DYNAMIC_CLASS(wxApp)
DECLARE_EVENT_TABLE()
};
#endif // __GTKAPPH__

View File

@ -51,7 +51,6 @@ public:
private:
DECLARE_DYNAMIC_CLASS(wxApp)
DECLARE_EVENT_TABLE()
wxVideoMode m_displayMode;
};

View File

@ -91,8 +91,6 @@ private:
WXColormap m_mainColormap;
WXDisplay* m_initialDisplay;
wxPerDisplayDataMap* m_perDisplayData;
DECLARE_EVENT_TABLE()
};
#endif

View File

@ -42,7 +42,6 @@ public:
virtual int GetPrintMode() const { return m_printMode; }
// implementation only
void OnIdle(wxIdleEvent& event);
void OnEndSession(wxCloseEvent& event);
void OnQueryEndSession(wxCloseEvent& event);

View File

@ -106,7 +106,6 @@ protected:
long m_maxRequestSize;
DECLARE_DYNAMIC_CLASS(wxApp)
DECLARE_EVENT_TABLE()
};
#endif // _WX_X11_APP_H_

View File

@ -101,11 +101,6 @@ WX_IMPLEMENT_GET_OBJC_CLASS(wxNSApplicationObserver,NSObject)
// wxApp Static member initialization
// ----------------------------------------------------------------------------
IMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler)
BEGIN_EVENT_TABLE(wxApp, wxEvtHandler)
EVT_IDLE(wxAppBase::OnIdle)
// EVT_END_SESSION(wxApp::OnEndSession)
// EVT_QUERY_END_SESSION(wxApp::OnQueryEndSession)
END_EVENT_TABLE()
// ----------------------------------------------------------------------------
// wxApp initialization/cleanup

View File

@ -365,6 +365,9 @@ void wxAppBase::DeletePendingObjects()
// Returns true if more time is needed.
bool wxAppBase::ProcessIdle()
{
// process pending wx events before sending idle events
ProcessPendingEvents();
wxIdleEvent event;
bool needMore = false;
wxWindowList::compatibility_iterator node = wxTopLevelWindows.GetFirst();
@ -376,7 +379,16 @@ bool wxAppBase::ProcessIdle()
node = node->GetNext();
}
needMore = wxAppConsole::ProcessIdle();
if (wxAppConsole::ProcessIdle())
needMore = true;
// 'Garbage' collection of windows deleted with Close().
DeletePendingObjects();
#if wxUSE_LOG
// flush the logged messages if any
wxLog::FlushActive();
#endif
wxUpdateUIEvent::ResetUpdateTime();
@ -413,27 +425,6 @@ bool wxAppBase::SendIdleEvents(wxWindow* win, wxIdleEvent& event)
return needMore;
}
void wxAppBase::OnIdle(wxIdleEvent& WXUNUSED(event))
{
// If there are pending events, we must process them: pending events
// are either events to the threads other than main or events posted
// with wxPostEvent() functions
// GRG: I have moved this here so that all pending events are processed
// before starting to delete any objects. This behaves better (in
// particular, wrt wxPostEvent) and is coherent with wxGTK's current
// behaviour. Changed Feb/2000 before 2.1.14
ProcessPendingEvents();
// 'Garbage' collection of windows deleted with Close().
DeletePendingObjects();
#if wxUSE_LOG
// flush the logged messages if any
wxLog::FlushActive();
#endif // wxUSE_LOG
}
// ----------------------------------------------------------------------------
// wxGUIAppTraitsBase
// ----------------------------------------------------------------------------

View File

@ -28,10 +28,6 @@
IMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler)
BEGIN_EVENT_TABLE(wxApp, wxEvtHandler)
EVT_IDLE(wxAppBase::OnIdle)
END_EVENT_TABLE()
wxApp::wxApp()
{
}

View File

@ -266,10 +266,6 @@ GtkWidget* wxGetRootWindow()
IMPLEMENT_DYNAMIC_CLASS(wxApp,wxEvtHandler)
BEGIN_EVENT_TABLE(wxApp, wxEvtHandler)
EVT_IDLE(wxAppBase::OnIdle)
END_EVENT_TABLE()
wxApp::wxApp()
{
#ifdef __WXDEBUG__

View File

@ -425,10 +425,6 @@ GtkWidget* wxGetRootWindow()
IMPLEMENT_DYNAMIC_CLASS(wxApp,wxEvtHandler)
BEGIN_EVENT_TABLE(wxApp, wxEvtHandler)
EVT_IDLE(wxAppBase::OnIdle)
END_EVENT_TABLE()
wxApp::wxApp()
{
#ifdef __WXDEBUG__

View File

@ -1136,12 +1136,7 @@ wxApp::wxApp()
void wxApp::OnIdle(wxIdleEvent& event)
{
wxAppBase::OnIdle(event);
// If they are pending events, we must process them: pending events are
// either events to the threads other than main or events posted with
// wxPostEvent() functions
wxMacProcessNotifierAndPendingEvents();
wxMacProcessNotifierEvents();
if (!wxMenuBar::MacGetInstalledMenuBar() && wxMenuBar::MacGetCommonMenuBar())
wxMenuBar::MacGetCommonMenuBar()->MacInstallMenuBar();

View File

@ -201,11 +201,6 @@ static void wxDestroyMGL_WM()
IMPLEMENT_DYNAMIC_CLASS(wxApp,wxEvtHandler)
BEGIN_EVENT_TABLE(wxApp, wxEvtHandler)
EVT_IDLE(wxAppBase::OnIdle)
END_EVENT_TABLE()
wxApp::wxApp()
{
}

View File

@ -73,10 +73,6 @@ wxHashTable *wxWidgetHashTable = NULL;
IMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler)
BEGIN_EVENT_TABLE(wxApp, wxEvtHandler)
EVT_IDLE(wxAppBase::OnIdle)
END_EVENT_TABLE()
#ifdef __WXDEBUG__
extern "C"
{

View File

@ -550,8 +550,6 @@ wxApp::~wxApp()
void wxApp::OnIdle(wxIdleEvent& event)
{
wxAppBase::OnIdle(event);
#if wxUSE_DC_CACHEING
// automated DC cache management: clear the cached DCs and bitmap
// if it's likely that the app has finished with them, that is, we

View File

@ -484,8 +484,6 @@ void wxApp::OnIdle( wxIdleEvent& rEvent )
gbInOnIdle = true;
wxAppBase::OnIdle(rEvent);
#if wxUSE_DC_CACHEING
// automated DC cache management: clear the cached DCs and bitmap
// if it's likely that the app has finished with them, that is, we

View File

@ -142,7 +142,6 @@ int wxApp::m_nCmdShow = 0;
IMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler)
BEGIN_EVENT_TABLE(wxApp, wxEvtHandler)
EVT_IDLE(wxApp::OnIdle)
EVT_END_SESSION(wxApp::OnEndSession)
EVT_QUERY_END_SESSION(wxApp::OnQueryEndSession)
END_EVENT_TABLE()
@ -245,11 +244,6 @@ wxApp::~wxApp()
// wxApp idle handling
// ----------------------------------------------------------------------------
void wxApp::OnIdle(wxIdleEvent& event)
{
wxAppBase::OnIdle(event);
}
void wxApp::WakeUpIdle()
{
}

View File

@ -86,10 +86,6 @@ long wxApp::sm_lastMessageTime = 0;
IMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler)
BEGIN_EVENT_TABLE(wxApp, wxEvtHandler)
EVT_IDLE(wxAppBase::OnIdle)
END_EVENT_TABLE()
bool wxApp::Initialize(int& argC, wxChar **argV)
{
#if defined(__WXDEBUG__) && !wxUSE_NANOX