Regression in update region handling

Robert Shearman rob at codeweavers.com
Mon Jan 24 11:47:19 CST 2005


Dmitry Timoshkov wrote:

>"Alexandre Julliard" <julliard at wine.dyndns.org> wrote:
>
>  
>
>>It's probably a regression around GetUpdateRect and related functions.
>>The easiest way to fix it would be to get me a copy of that app, if
>>that's possible.
>>    
>>
>
>Haven't the code demonstrating the problem already been sent to the list?
>  
>

>   case WM_PAINT:
>    {
>     struct
>     {
>      RECT rcPaint;
>      HDC hdc;
>     } ps;
>     if (!GetUpdateRect(wnd,&ps.rcPaint,0))
>      GetClientRect(wnd,&ps.rcPaint);
>     ps.hdc = GetDC(wnd);
>     
>     int min,max;
>     min = display_offset + (ps.rcPaint.top/item_height);
>     max = display_offset + (ps.rcPaint.bottom/item_height) + 2;
>     int n;
>     if (max>get_count()) max = get_count();
>     for(n=min;n<max;n++) repaint(n,ps.hdc,&ps.rcPaint);
>     
>     int blank_top = (get_count() - display_offset) * item_height;
>     if (blank_top < ps.rcPaint.bottom)
>     {
>      RECT temp = ps.rcPaint;
>      temp.top = blank_top;
>      HBRUSH br = CreateSolidBrush(cfg_playlist_background);
>      FillRect(ps.hdc,&temp,br);
>      DeleteObject(br);
>     }
>     ReleaseDC(wnd,ps.hdc);
>     ValidateRect(wnd,&ps.rcPaint);
>
>


I've tried it and it ran without problem. I also tried a few variants, 
without getting an infinite loop.

Rob



More information about the wine-devel mailing list