From a82152f7e3de57f3f98f771bdb8db808699fd61f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 13 Feb 2015 19:36:06 +0000 Subject: [PATCH] Use non-static reentrancy guard in wxScrollHelper::AdjustScrollbars(). This prevented calls to AdjustScrollbars() of another window from doing anything if they were called due to a size change from AdjustScrollbars() of an outer window. Closes #16852. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78483 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/generic/scrolwin.h | 3 +++ src/generic/scrlwing.cpp | 6 ++---- 2 files changed, 5 insertions(+), 4 deletions(-) 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