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:
@@ -497,10 +497,6 @@ public:
|
|||||||
wxDEPRECATED( bool Initialized() );
|
wxDEPRECATED( bool Initialized() );
|
||||||
#endif // WXWIN_COMPATIBILITY_2_6
|
#endif // WXWIN_COMPATIBILITY_2_6
|
||||||
|
|
||||||
// perform standard OnIdle behaviour, ensure that this is always called
|
|
||||||
void OnIdle(wxIdleEvent& event);
|
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// delete all objects in wxPendingDelete list
|
// delete all objects in wxPendingDelete list
|
||||||
void DeletePendingObjects();
|
void DeletePendingObjects();
|
||||||
|
@@ -25,7 +25,6 @@ typedef const struct __CFString * CFStringRef;
|
|||||||
class WXDLLEXPORT wxApp: public wxAppBase
|
class WXDLLEXPORT wxApp: public wxAppBase
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxApp)
|
DECLARE_DYNAMIC_CLASS(wxApp)
|
||||||
DECLARE_EVENT_TABLE()
|
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
// initialization
|
// initialization
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
|
@@ -41,7 +41,6 @@ private:
|
|||||||
wxVideoMode m_videoMode;
|
wxVideoMode m_videoMode;
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxApp)
|
DECLARE_DYNAMIC_CLASS(wxApp)
|
||||||
DECLARE_EVENT_TABLE()
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _WX_DFB_APP_H_
|
#endif // _WX_DFB_APP_H_
|
||||||
|
@@ -81,7 +81,6 @@ private:
|
|||||||
guint m_idleSourceId;
|
guint m_idleSourceId;
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxApp)
|
DECLARE_DYNAMIC_CLASS(wxApp)
|
||||||
DECLARE_EVENT_TABLE()
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _WX_GTK_APP_H_
|
#endif // _WX_GTK_APP_H_
|
||||||
|
@@ -72,7 +72,6 @@ private:
|
|||||||
#endif // __WXDEBUG__
|
#endif // __WXDEBUG__
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxApp)
|
DECLARE_DYNAMIC_CLASS(wxApp)
|
||||||
DECLARE_EVENT_TABLE()
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __GTKAPPH__
|
#endif // __GTKAPPH__
|
||||||
|
@@ -51,7 +51,6 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_DYNAMIC_CLASS(wxApp)
|
DECLARE_DYNAMIC_CLASS(wxApp)
|
||||||
DECLARE_EVENT_TABLE()
|
|
||||||
|
|
||||||
wxVideoMode m_displayMode;
|
wxVideoMode m_displayMode;
|
||||||
};
|
};
|
||||||
|
@@ -91,8 +91,6 @@ private:
|
|||||||
WXColormap m_mainColormap;
|
WXColormap m_mainColormap;
|
||||||
WXDisplay* m_initialDisplay;
|
WXDisplay* m_initialDisplay;
|
||||||
wxPerDisplayDataMap* m_perDisplayData;
|
wxPerDisplayDataMap* m_perDisplayData;
|
||||||
|
|
||||||
DECLARE_EVENT_TABLE()
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -42,7 +42,6 @@ public:
|
|||||||
virtual int GetPrintMode() const { return m_printMode; }
|
virtual int GetPrintMode() const { return m_printMode; }
|
||||||
|
|
||||||
// implementation only
|
// implementation only
|
||||||
void OnIdle(wxIdleEvent& event);
|
|
||||||
void OnEndSession(wxCloseEvent& event);
|
void OnEndSession(wxCloseEvent& event);
|
||||||
void OnQueryEndSession(wxCloseEvent& event);
|
void OnQueryEndSession(wxCloseEvent& event);
|
||||||
|
|
||||||
|
@@ -106,7 +106,6 @@ protected:
|
|||||||
long m_maxRequestSize;
|
long m_maxRequestSize;
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxApp)
|
DECLARE_DYNAMIC_CLASS(wxApp)
|
||||||
DECLARE_EVENT_TABLE()
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _WX_X11_APP_H_
|
#endif // _WX_X11_APP_H_
|
||||||
|
@@ -101,11 +101,6 @@ WX_IMPLEMENT_GET_OBJC_CLASS(wxNSApplicationObserver,NSObject)
|
|||||||
// wxApp Static member initialization
|
// wxApp Static member initialization
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler)
|
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
|
// wxApp initialization/cleanup
|
||||||
|
@@ -365,6 +365,9 @@ 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
|
||||||
|
ProcessPendingEvents();
|
||||||
|
|
||||||
wxIdleEvent event;
|
wxIdleEvent event;
|
||||||
bool needMore = false;
|
bool needMore = false;
|
||||||
wxWindowList::compatibility_iterator node = wxTopLevelWindows.GetFirst();
|
wxWindowList::compatibility_iterator node = wxTopLevelWindows.GetFirst();
|
||||||
@@ -376,7 +379,16 @@ bool wxAppBase::ProcessIdle()
|
|||||||
node = node->GetNext();
|
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();
|
wxUpdateUIEvent::ResetUpdateTime();
|
||||||
|
|
||||||
@@ -413,27 +425,6 @@ bool wxAppBase::SendIdleEvents(wxWindow* win, wxIdleEvent& event)
|
|||||||
return needMore;
|
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
|
// wxGUIAppTraitsBase
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@@ -28,10 +28,6 @@
|
|||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler)
|
IMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler)
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxApp, wxEvtHandler)
|
|
||||||
EVT_IDLE(wxAppBase::OnIdle)
|
|
||||||
END_EVENT_TABLE()
|
|
||||||
|
|
||||||
wxApp::wxApp()
|
wxApp::wxApp()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@@ -266,10 +266,6 @@ GtkWidget* wxGetRootWindow()
|
|||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxApp,wxEvtHandler)
|
IMPLEMENT_DYNAMIC_CLASS(wxApp,wxEvtHandler)
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxApp, wxEvtHandler)
|
|
||||||
EVT_IDLE(wxAppBase::OnIdle)
|
|
||||||
END_EVENT_TABLE()
|
|
||||||
|
|
||||||
wxApp::wxApp()
|
wxApp::wxApp()
|
||||||
{
|
{
|
||||||
#ifdef __WXDEBUG__
|
#ifdef __WXDEBUG__
|
||||||
|
@@ -425,10 +425,6 @@ GtkWidget* wxGetRootWindow()
|
|||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxApp,wxEvtHandler)
|
IMPLEMENT_DYNAMIC_CLASS(wxApp,wxEvtHandler)
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxApp, wxEvtHandler)
|
|
||||||
EVT_IDLE(wxAppBase::OnIdle)
|
|
||||||
END_EVENT_TABLE()
|
|
||||||
|
|
||||||
wxApp::wxApp()
|
wxApp::wxApp()
|
||||||
{
|
{
|
||||||
#ifdef __WXDEBUG__
|
#ifdef __WXDEBUG__
|
||||||
|
@@ -1136,12 +1136,7 @@ wxApp::wxApp()
|
|||||||
|
|
||||||
void wxApp::OnIdle(wxIdleEvent& event)
|
void wxApp::OnIdle(wxIdleEvent& event)
|
||||||
{
|
{
|
||||||
wxAppBase::OnIdle(event);
|
wxMacProcessNotifierEvents();
|
||||||
|
|
||||||
// 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();
|
|
||||||
|
|
||||||
if (!wxMenuBar::MacGetInstalledMenuBar() && wxMenuBar::MacGetCommonMenuBar())
|
if (!wxMenuBar::MacGetInstalledMenuBar() && wxMenuBar::MacGetCommonMenuBar())
|
||||||
wxMenuBar::MacGetCommonMenuBar()->MacInstallMenuBar();
|
wxMenuBar::MacGetCommonMenuBar()->MacInstallMenuBar();
|
||||||
|
@@ -201,11 +201,6 @@ static void wxDestroyMGL_WM()
|
|||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxApp,wxEvtHandler)
|
IMPLEMENT_DYNAMIC_CLASS(wxApp,wxEvtHandler)
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxApp, wxEvtHandler)
|
|
||||||
EVT_IDLE(wxAppBase::OnIdle)
|
|
||||||
END_EVENT_TABLE()
|
|
||||||
|
|
||||||
|
|
||||||
wxApp::wxApp()
|
wxApp::wxApp()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@@ -73,10 +73,6 @@ wxHashTable *wxWidgetHashTable = NULL;
|
|||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler)
|
IMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler)
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxApp, wxEvtHandler)
|
|
||||||
EVT_IDLE(wxAppBase::OnIdle)
|
|
||||||
END_EVENT_TABLE()
|
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
#ifdef __WXDEBUG__
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
|
@@ -550,8 +550,6 @@ wxApp::~wxApp()
|
|||||||
|
|
||||||
void wxApp::OnIdle(wxIdleEvent& event)
|
void wxApp::OnIdle(wxIdleEvent& event)
|
||||||
{
|
{
|
||||||
wxAppBase::OnIdle(event);
|
|
||||||
|
|
||||||
#if wxUSE_DC_CACHEING
|
#if wxUSE_DC_CACHEING
|
||||||
// automated DC cache management: clear the cached DCs and bitmap
|
// automated DC cache management: clear the cached DCs and bitmap
|
||||||
// if it's likely that the app has finished with them, that is, we
|
// if it's likely that the app has finished with them, that is, we
|
||||||
|
@@ -484,8 +484,6 @@ void wxApp::OnIdle( wxIdleEvent& rEvent )
|
|||||||
|
|
||||||
gbInOnIdle = true;
|
gbInOnIdle = true;
|
||||||
|
|
||||||
wxAppBase::OnIdle(rEvent);
|
|
||||||
|
|
||||||
#if wxUSE_DC_CACHEING
|
#if wxUSE_DC_CACHEING
|
||||||
// automated DC cache management: clear the cached DCs and bitmap
|
// automated DC cache management: clear the cached DCs and bitmap
|
||||||
// if it's likely that the app has finished with them, that is, we
|
// if it's likely that the app has finished with them, that is, we
|
||||||
|
@@ -142,7 +142,6 @@ int wxApp::m_nCmdShow = 0;
|
|||||||
IMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler)
|
IMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler)
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxApp, wxEvtHandler)
|
BEGIN_EVENT_TABLE(wxApp, wxEvtHandler)
|
||||||
EVT_IDLE(wxApp::OnIdle)
|
|
||||||
EVT_END_SESSION(wxApp::OnEndSession)
|
EVT_END_SESSION(wxApp::OnEndSession)
|
||||||
EVT_QUERY_END_SESSION(wxApp::OnQueryEndSession)
|
EVT_QUERY_END_SESSION(wxApp::OnQueryEndSession)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
@@ -245,11 +244,6 @@ wxApp::~wxApp()
|
|||||||
// wxApp idle handling
|
// wxApp idle handling
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
void wxApp::OnIdle(wxIdleEvent& event)
|
|
||||||
{
|
|
||||||
wxAppBase::OnIdle(event);
|
|
||||||
}
|
|
||||||
|
|
||||||
void wxApp::WakeUpIdle()
|
void wxApp::WakeUpIdle()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@@ -86,10 +86,6 @@ long wxApp::sm_lastMessageTime = 0;
|
|||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler)
|
IMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler)
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxApp, wxEvtHandler)
|
|
||||||
EVT_IDLE(wxAppBase::OnIdle)
|
|
||||||
END_EVENT_TABLE()
|
|
||||||
|
|
||||||
bool wxApp::Initialize(int& argC, wxChar **argV)
|
bool wxApp::Initialize(int& argC, wxChar **argV)
|
||||||
{
|
{
|
||||||
#if defined(__WXDEBUG__) && !wxUSE_NANOX
|
#if defined(__WXDEBUG__) && !wxUSE_NANOX
|
||||||
|
Reference in New Issue
Block a user