]> git.saurik.com Git - wxWidgets.git/commitdiff
process pending wx events before sending idle events
authorPaul Cornett <paulcor@bullseye.com>
Sun, 8 Jul 2007 05:31:32 +0000 (05:31 +0000)
committerPaul Cornett <paulcor@bullseye.com>
Sun, 8 Jul 2007 05:31:32 +0000 (05:31 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47229 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

21 files changed:
include/wx/app.h
include/wx/cocoa/app.h
include/wx/dfb/app.h
include/wx/gtk/app.h
include/wx/gtk1/app.h
include/wx/mgl/app.h
include/wx/motif/app.h
include/wx/palmos/app.h
include/wx/x11/app.h
src/cocoa/app.mm
src/common/appcmn.cpp
src/dfb/app.cpp
src/gtk/app.cpp
src/gtk1/app.cpp
src/mac/carbon/app.cpp
src/mgl/app.cpp
src/motif/app.cpp
src/msw/app.cpp
src/os2/app.cpp
src/palmos/app.cpp
src/x11/app.cpp

index d12af8b3ae11f08a3c49b008dcd4e1769bb27fb8..b5542f913ae75360134892f16d9ae0e5db554cc9 100644 (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();
index 326b317d02382250b1d6a4348651ec6388d66b06..50900b4f18b9d14d54b86eea1cefb4e9b7fff53a 100644 (file)
@@ -25,7 +25,6 @@ typedef const struct __CFString * CFStringRef;
 class WXDLLEXPORT wxApp: public wxAppBase
 {
     DECLARE_DYNAMIC_CLASS(wxApp)
-    DECLARE_EVENT_TABLE()
 // ------------------------------------------------------------------------
 // initialization
 // ------------------------------------------------------------------------
index 2034b3c77dad757b13cc24484d843fd5f5dc3534..80e7dfcb088e6dd7d95f04fea347065615ac4e47 100644 (file)
@@ -41,7 +41,6 @@ private:
     wxVideoMode m_videoMode;
 
     DECLARE_DYNAMIC_CLASS(wxApp)
-    DECLARE_EVENT_TABLE()
 };
 
 #endif // _WX_DFB_APP_H_
index aa63278eebd3d18c507eba03265577534361fd3b..84580a1422286ab5e5ed5fa48fb37d84e56432bd 100644 (file)
@@ -81,7 +81,6 @@ private:
     guint m_idleSourceId;
 
     DECLARE_DYNAMIC_CLASS(wxApp)
-    DECLARE_EVENT_TABLE()
 };
 
 #endif // _WX_GTK_APP_H_
index 27c5e7faafd1082b8a020dee4d85edb413831020..b990781116f3878608221f0f72f98ea6d16d3fc8 100644 (file)
@@ -72,7 +72,6 @@ private:
 #endif // __WXDEBUG__
 
     DECLARE_DYNAMIC_CLASS(wxApp)
-    DECLARE_EVENT_TABLE()
 };
 
 #endif // __GTKAPPH__
index 7a5e0b0f1f629d1112f7c3741050fe3db715d7a4..c92cab42e699f894203015b1c62d111cde3528fa 100644 (file)
@@ -51,7 +51,6 @@ public:
 
 private:
     DECLARE_DYNAMIC_CLASS(wxApp)
-    DECLARE_EVENT_TABLE()
 
     wxVideoMode m_displayMode;
 };
index 985a7e22e187a7640379902528835d99b8093f49..8c1159b34c921c4b1b8d78f15edc85a20064d7da 100644 (file)
@@ -91,8 +91,6 @@ private:
     WXColormap            m_mainColormap;
     WXDisplay*            m_initialDisplay;
     wxPerDisplayDataMap*  m_perDisplayData;
-
-    DECLARE_EVENT_TABLE()
 };
 
 #endif
index 65f4303b011dc155290854187d3631a9b5687369..4211588f04ba5fb2fb90130a1d2e996a182b68e1 100644 (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);
 
index b78e4abae924b4fa8141d435c4c35cd2ec6b5c33..e6faab08e1c0c3a55e9803e64e383eb64539dbea 100644 (file)
@@ -106,7 +106,6 @@ protected:
     long                  m_maxRequestSize;
 
     DECLARE_DYNAMIC_CLASS(wxApp)
-    DECLARE_EVENT_TABLE()
 };
 
 #endif // _WX_X11_APP_H_
index e2f29aac351a1390c61e59fccf8ebefecf8fb9c5..0ac5bca28e2cbb756468c7b14be3a1723f813ca7 100644 (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
index dca75fefd9b3fdb7fde3a6b9603e4ee07ecbfcc7..8a33c3f31ffb4fec8ddebea7e090f5090b454aab 100644 (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
 // ----------------------------------------------------------------------------
index bfde03508efa4fb9ba67e793a3de3b3cfb8c8fcf..8ae8339fe50f4a5ddb0f5763a7e1a26011bc20c2 100644 (file)
 
 IMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler)
 
-BEGIN_EVENT_TABLE(wxApp, wxEvtHandler)
-    EVT_IDLE(wxAppBase::OnIdle)
-END_EVENT_TABLE()
-
 wxApp::wxApp()
 {
 }
index ad027a0232fbd48ce2aea050093d39ee838ced60..33cf2dc6a0e76688f7ab048bade8bd84cb995280 100644 (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__
index c7d9c5b71f83b5f912088492d9bc517fe3a2b8a6..84590d5759d858f050f8841c8698a6af3a863db0 100644 (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__
index a48440d002189e6f3782ff805efdae77290f3a8a..d833bb02d7991dd3ae80f69dc13cc3cddf3aa80f 100644 (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();
index f94600c41e0a15346d8efa0efde8b3b7b2bd6526..c0338c7834953a78b9fff7b64fb4d0dc8280ba0b 100644 (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()
 {
 }
index e36d19b6e6f2873f01de6bb3e70a2e6c0be642a8..c635bb4a19c90eb081c6b3802df54798cd1c13c6 100644 (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"
 {
index 843b4d3c887337e02fa36d81e5a2a76214bbe080..f1cdf6d3856e55ef6a010cd3b3ebe8757ee967b9 100644 (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
index 758e6c7c449c7ca93282e188834620bd09a2ac5b..3620b182ac857fec94bd8772ef6c633b56a63fb9 100644 (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
index cfc5e1e70af14c2dc0f41d287455defbf1f65b71..888ab4bf8cb005e678cad81460f8cbe3ef3c41ba 100644 (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()
 {
 }
index 9677cf46fcac7587f34000aa19aebc2c9e7e80ee..17a553ffe9299698feee90a8c0b6b11933ee6468 100644 (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