[Bug 10522] endless WM_PAINT loop bug (update regions, queue paint count)

wine-bugs at winehq.org wine-bugs at winehq.org
Thu Jul 2 23:42:24 CDT 2009


http://bugs.winehq.org/show_bug.cgi?id=10522





--- Comment #14 from Austin Lund <austin.lund at gmail.com>  2009-07-02 23:42:24 ---
I think I've found the reason for this.  It seems that when wine does
BeginPaint() it checks to see if the non-client area is within the update
region.  When doing this check, the region is validated in that step.  If there
is a region that needs updating a WM_NCPAINT message is sent.  In this case the
RedrawWindow() function will invalidate the whole thing.  There is nowhere else
that this can become valid.  And hence at EndPaint() things are still marked as
invalid.  Then a WM_PAINT message is added and things go round again.

To explain this I've tried to do some psuedocode of what happens on wine and
windows:


Wine:

WndProc WM_PAINT
DefWndProc(WM_PAINT)
    BeginPaint()
        send_ncpaint()
            get_update_region()  // Region Validated
            ...
            SendMessageW(WM_NCPAINT)
            WndProc WM_NCPAINT
                RedrawWindow()  // Invalidates window
                DefWndProc(WM_NCPAINT) // Still invalid
        ...
    EndPaint() // Still Invaid
As the window is marked invalid It calls WM_PAINT again.


Windows:

WndProc WM_PAINT
DefWndProc(WM_PAINT)
    BeginPaint()
        FindUpdateRegion() // Does not validate region
        SendMessageW(WM_NCPAINT) // Still region invalid
        WndProc WM_NCPAINT
            RedrawWindow()  // Region still invalid so does not matter
            DefWndProc(WM_NCPAINT) // Still Invalid
        ... // Painting instructions
        ValidateUpdateRegion() // Finally Validated Update Region
    ...
    EndPaint() // Region fully validated
Nothing marked as invalid!

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list