Hi, second try to prevent that invalidating a NULL region will cause WM_PAINT messages. Changelog: windows : painting.c In RDW_UpdateRgn(), if hRgn is zero, clear the windows update region if it is an empty region. Rein. -- Rein Klazes rklazes@xxxxxxxxx
--- wine/windows/painting.c 2003-12-05 07:35:15.000000000 +0100 +++ mywine/windows/painting.c 2004-01-06 10:14:54.000000000 +0100 @@ -460,7 +460,21 @@ wndPtr->hrgnUpdate = (HRGN)1; } else - hRgn = wndPtr->hrgnUpdate; /* this is a trick that depends on code in PAINT_RedrawWindow() */ + { + /* hRgn is zero */ + if( wndPtr->hrgnUpdate > (HRGN)1) + { + GetRgnBox( wndPtr->hrgnUpdate, &r ); + if( IsRectEmpty( &r ) ) + { + DeleteObject( wndPtr->hrgnUpdate ); + wndPtr->hrgnUpdate = 0; + goto end; + } + } + hRgn = wndPtr->hrgnUpdate; /* this is a trick that depends + * on code in RDW_Paint() */ + } if( !bHadOne && !(wndPtr->flags & WIN_INTERNAL_PAINT) ) add_paint_count( wndPtr->hwndSelf, 1 ); @@ -666,7 +680,7 @@ { if (SendMessageW( hWnd, (bIcon) ? WM_ICONERASEBKGND : WM_ERASEBKGND, (WPARAM)hDC, 0 )) - wndPtr->flags &= ~WIN_NEEDS_ERASEBKGND; + wndPtr->flags &= ~WIN_NEEDS_ERASEBKGND; ReleaseDC( hWnd, hDC ); } }