From ff3493c0cefd6713772be9747b8a1e6d874e1afe Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 31 May 2013 23:21:06 +0000 Subject: [PATCH] Use deferred window positioning in wxWindow::Layout() in wxMSW. 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 | 2 ++ src/common/wincmn.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/common/sizer.cpp b/src/common/sizer.cpp index 37f31766a3..1fd2b74d71 100644 --- a/src/common/sizer.cpp +++ b/src/common/sizer.cpp @@ -976,6 +976,8 @@ void wxSizer::Layout() CalcMin(); // Applies the layout and repositions/resizes the items + wxWindow::ChildrenRepositioningGuard repositionGuard(m_containingWindow); + RecalcSizes(); } diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index 1601d08e42..3c2c0f4e1d 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -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(); -- 2.45.2