diff --git a/include/wx/generic/scrolwin.h b/include/wx/generic/scrolwin.h index 863cdf923e..efcbd0445e 100644 --- a/include/wx/generic/scrolwin.h +++ b/include/wx/generic/scrolwin.h @@ -10,6 +10,8 @@ #ifndef _WX_GENERIC_SCROLLWIN_H_ #define _WX_GENERIC_SCROLLWIN_H_ +#include "wx/recguard.h" + // ---------------------------------------------------------------------------- // generic wxScrollHelper implementation // ---------------------------------------------------------------------------- @@ -45,6 +47,7 @@ private: wxScrollbarVisibility m_xVisibility, m_yVisibility; + wxRecursionGuardFlag m_adjustScrollFlagReentrancy; wxDECLARE_NO_COPY_CLASS(wxScrollHelper); }; diff --git a/src/generic/scrlwing.cpp b/src/generic/scrlwing.cpp index ff248ce2d1..530d36b733 100644 --- a/src/generic/scrlwing.cpp +++ b/src/generic/scrlwing.cpp @@ -39,8 +39,6 @@ #include "wx/scrolbar.h" #endif -#include "wx/recguard.h" - #ifdef __WXMSW__ #include // for DLGC_WANTARROWS #include "wx/msw/winundef.h" @@ -1205,6 +1203,7 @@ wxScrollHelper::wxScrollHelper(wxWindow *winToScroll) { m_xVisibility = m_yVisibility = wxSHOW_SB_DEFAULT; + m_adjustScrollFlagReentrancy = 0; } bool wxScrollHelper::IsScrollbarShown(int orient) const @@ -1305,8 +1304,7 @@ wxScrollHelper::DoAdjustScrollbar(int orient, void wxScrollHelper::AdjustScrollbars() { - static wxRecursionGuardFlag s_flagReentrancy; - wxRecursionGuard guard(s_flagReentrancy); + wxRecursionGuard guard(m_adjustScrollFlagReentrancy); if ( guard.IsInside() ) { // don't reenter AdjustScrollbars() while another call to