Uncleared WM_PAINT loop problem

Gerard Patel gerard.patel at nerim.net
Thu Dec 13 16:29:54 CST 2001


At 02:13 PM 12/12/2001 -0500, you wrote:
>I have a problem where an edit control get stuck in an infinite WM_PAINT
>loop.
>
>BeginPaint never clears the paint count because of this code:
>
> if(((hrgnUpdate = wndPtr->hrgnUpdate) != 0) || (wndPtr->flags &
>WIN_INTERNAL_PAINT))
>        add_paint_count( hwnd, -1 );
>
>
>if wndPtr->hrgnUpdate is 0 then the paint count is never decremented here
>and nowhere else attempts to decrement it and we land up in an infinite
>paint loop. I'm not sure how we get to this point the a NULL update region
>(which may be a bug anyway), but there should still be a method of breaking
>out of this loop once we are there.
>
>I tried removing the test and always calling add_paint_count and this
>appears to fix the problem.
>

With current Cvs code the infinite loop should have gone away...
Alexandre Julliard has changed a strangeness of BeginPaint :
when the update region is null, Wine used to paint the whole 
window. New code set an empty painting rectangle. 

However, if the empty update region comes from an earlier Wine
bug, the new code replaces excessive repainting with no
repainting at all. 
I have already an app that shows this problem. As I was saying in
reply to Andi Mohr, better code can reveal better old bugs...

Gerard





More information about the wine-devel mailing list