[2/2] richedit: Prevent redundant rewraps when scrollbar is shown.

Dylan Smith dylan.ah.smith at gmail.com
Mon Jan 5 12:14:31 CST 2009


A common case for richedit controls are that a large amount of text is
set initially with word wrap enabled.  This causes the initially
wrapping of the text, which also calculates the text length.  After this
the vertical scrollbar will be shown, which causes the text to be
rewrapped again.  After this there are two redundant rewraps that are
done which this patch eliminates.

First when the scrollbar is shown from ME_UpdateScrollBar, ShowScrollBar
causes a WM_SIZE message to be sent immediately before the text is
explicitily rewrapped in this function.  The WM_SIZE message causes a
rewrap, and then calls ME_UpdateScrollBar before the scrollbar state has
been updated, so it causes another rewrap.  Once the WM_SIZE message is
finished being processes, the initial call to ME_UpdateScrollBar rewraps
the text.  This patch avoids the redundant rewraps in this scenario.
---
 dlls/riched20/paint.c |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0002-richedit-Prevent-redundant-rewraps-when-scrollba.diff.txt
Url: http://www.winehq.org/pipermail/wine-patches/attachments/20090105/ab1ab90d/attachment.txt 


More information about the wine-patches mailing list