From c6de9c117ba81aabf8abbde77b4fdd757ec0bcfa Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Fri, 4 Oct 2002 20:10:14 +0000 Subject: [PATCH] Added work-around/fix for redraw bug in idle handler. I now send internal idle calls whereas normal idle events still get block by the recursion block. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17457 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/app.cpp | 20 +++++++++++--------- src/gtk/dialog.cpp | 2 -- src/gtk1/app.cpp | 20 +++++++++++--------- src/gtk1/dialog.cpp | 2 -- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/gtk/app.cpp b/src/gtk/app.cpp index 61b722b708..5100ef3060 100644 --- a/src/gtk/app.cpp +++ b/src/gtk/app.cpp @@ -477,6 +477,16 @@ GdkVisual *wxApp::GetGdkVisual() bool wxApp::ProcessIdle() { + wxWindowList::Node* node = wxTopLevelWindows.GetFirst(); + node = wxTopLevelWindows.GetFirst(); + while (node) + { + wxWindow* win = node->GetData(); + CallInternalIdle( win ); + + node = node->GetNext(); + } + wxIdleEvent event; event.SetEventObject( this ); ProcessEvent( event ); @@ -487,7 +497,7 @@ bool wxApp::ProcessIdle() void wxApp::OnIdle( wxIdleEvent &event ) { static bool s_inOnIdle = FALSE; - + // Avoid recursion (via ProcessEvent default case) if (s_inOnIdle) return; @@ -524,14 +534,6 @@ bool wxApp::SendIdleEvents() node = node->GetNext(); } - node = wxTopLevelWindows.GetFirst(); - while (node) - { - wxWindow* win = node->GetData(); - CallInternalIdle( win ); - - node = node->GetNext(); - } return needMore; } diff --git a/src/gtk/dialog.cpp b/src/gtk/dialog.cpp index 68a991a371..474b60b633 100644 --- a/src/gtk/dialog.cpp +++ b/src/gtk/dialog.cpp @@ -30,8 +30,6 @@ extern void wxapp_install_idle_handler(); extern bool g_isIdle; extern int g_openDialogs; - - //----------------------------------------------------------------------------- // wxDialog //----------------------------------------------------------------------------- diff --git a/src/gtk1/app.cpp b/src/gtk1/app.cpp index 61b722b708..5100ef3060 100644 --- a/src/gtk1/app.cpp +++ b/src/gtk1/app.cpp @@ -477,6 +477,16 @@ GdkVisual *wxApp::GetGdkVisual() bool wxApp::ProcessIdle() { + wxWindowList::Node* node = wxTopLevelWindows.GetFirst(); + node = wxTopLevelWindows.GetFirst(); + while (node) + { + wxWindow* win = node->GetData(); + CallInternalIdle( win ); + + node = node->GetNext(); + } + wxIdleEvent event; event.SetEventObject( this ); ProcessEvent( event ); @@ -487,7 +497,7 @@ bool wxApp::ProcessIdle() void wxApp::OnIdle( wxIdleEvent &event ) { static bool s_inOnIdle = FALSE; - + // Avoid recursion (via ProcessEvent default case) if (s_inOnIdle) return; @@ -524,14 +534,6 @@ bool wxApp::SendIdleEvents() node = node->GetNext(); } - node = wxTopLevelWindows.GetFirst(); - while (node) - { - wxWindow* win = node->GetData(); - CallInternalIdle( win ); - - node = node->GetNext(); - } return needMore; } diff --git a/src/gtk1/dialog.cpp b/src/gtk1/dialog.cpp index 68a991a371..474b60b633 100644 --- a/src/gtk1/dialog.cpp +++ b/src/gtk1/dialog.cpp @@ -30,8 +30,6 @@ extern void wxapp_install_idle_handler(); extern bool g_isIdle; extern int g_openDialogs; - - //----------------------------------------------------------------------------- // wxDialog //-----------------------------------------------------------------------------