]> git.saurik.com Git - wxWidgets.git/commitdiff
Use deferred window positioning in wxWindow::Layout() in wxMSW.
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 31 May 2013 23:21:06 +0000 (23:21 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 31 May 2013 23:21:06 +0000 (23:21 +0000)
Ensure that {Begin,End}RepositioningChildren() are called before/after
changing the positions of multiple children, whether we're using sizers or
constraints.

This fixes display corruption which could happen under Windows 7 and a child
resized first became bigger, pushing off the children resized later.

Closes #15214.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74067 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/sizer.cpp
src/common/wincmn.cpp

index 37f31766a341d3839947ae31afeee41261d9d296..1fd2b74d71a158ec712814c7181d251c2bff30f4 100644 (file)
@@ -976,6 +976,8 @@ void wxSizer::Layout()
     CalcMin();
 
     // Applies the layout and repositions/resizes the items
+    wxWindow::ChildrenRepositioningGuard repositionGuard(m_containingWindow);
+
     RecalcSizes();
 }
 
index 1601d08e42814253340bcc7730db665e60069ba1..3c2c0f4e1d363f6264f3babe188074d2ebb1670a 100644 (file)
@@ -2610,6 +2610,8 @@ void wxWindowBase::SetConstraintSizes(bool recurse)
     wxLayoutConstraints *constr = GetConstraints();
     if ( constr && constr->AreSatisfied() )
     {
+        ChildrenRepositioningGuard repositionGuard(this);
+
         int x = constr->left.GetValue();
         int y = constr->top.GetValue();
         int w = constr->width.GetValue();