fixed extraneous scrolling when scrollbars are added/removed (patch 788026; bug 746618)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22836 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -44,6 +44,7 @@
|
||||
#include "wx/timer.h"
|
||||
#endif
|
||||
#include "wx/sizer.h"
|
||||
#include "wx/recguard.h"
|
||||
|
||||
#ifdef __WXMSW__
|
||||
#include <windows.h> // for DLGC_WANTARROWS
|
||||
@@ -621,6 +622,19 @@ int wxScrollHelper::CalcScrollInc(wxScrollWinEvent& event)
|
||||
// Adjust the scrollbars - new version.
|
||||
void wxScrollHelper::AdjustScrollbars()
|
||||
{
|
||||
static wxRecursionGuardFlag s_flagReentrancy;
|
||||
wxRecursionGuard guard(s_flagReentrancy);
|
||||
if ( guard.IsInside() )
|
||||
{
|
||||
// don't reenter AdjustScrollbars() while another call to
|
||||
// AdjustScrollbars() is in progress because this may lead to calling
|
||||
// ScrollWindow() twice and this can really happen under MSW if
|
||||
// SetScrollbar() call below adds or removes the scrollbar which
|
||||
// changes the window size and hence results in another
|
||||
// AdjustScrollbars() call
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef __WXMAC__
|
||||
m_targetWindow->Update();
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user