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
This commit is contained in:
Vadim Zeitlin
2015-02-13 19:36:06 +00:00
parent cb06ecb9eb
commit a82152f7e3
2 changed files with 5 additions and 4 deletions

View File

@@ -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);
};

View File

@@ -39,8 +39,6 @@
#include "wx/scrolbar.h"
#endif
#include "wx/recguard.h"
#ifdef __WXMSW__
#include <windows.h> // 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