Don't optimize if there are child windows
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44437 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -41,6 +41,10 @@
|
|||||||
#include "wx/sizer.h"
|
#include "wx/sizer.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __WXMAC__
|
||||||
|
#include "wx/scrolbar.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "wx/recguard.h"
|
#include "wx/recguard.h"
|
||||||
|
|
||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
@@ -464,6 +468,22 @@ wxWindow *wxScrollHelper::GetTargetWindow() const
|
|||||||
return m_targetWindow;
|
return m_targetWindow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __WXMAC__
|
||||||
|
static bool wxScrolledWindowHasChildren(wxWindow* win)
|
||||||
|
{
|
||||||
|
wxWindowList::compatibility_iterator node = win->GetChildren().GetFirst();
|
||||||
|
while ( node )
|
||||||
|
{
|
||||||
|
wxWindow* child = node->GetData();
|
||||||
|
if ( !child->IsKindOf(CLASSINFO(wxScrollBar)) )
|
||||||
|
return true;
|
||||||
|
|
||||||
|
node = node->GetNext();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// scrolling implementation itself
|
// scrolling implementation itself
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -482,6 +502,7 @@ void wxScrollHelper::HandleOnScroll(wxScrollWinEvent& event)
|
|||||||
bool needsRefresh = false;
|
bool needsRefresh = false;
|
||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
// OS X blocks on immediate redraws, so make this a refresh
|
// OS X blocks on immediate redraws, so make this a refresh
|
||||||
|
if (!wxScrolledWindowHasChildren(m_targetWindow))
|
||||||
needsRefresh = true;
|
needsRefresh = true;
|
||||||
#endif
|
#endif
|
||||||
int dx = 0,
|
int dx = 0,
|
||||||
|
Reference in New Issue
Block a user