Fixed bug that caused the whole window to be repainted by RedrawWindow

when the passed region was empty.
This commit is contained in:
Alexandre Julliard 2005-01-28 17:23:25 +00:00
parent 7d92b5d8b4
commit 6db71654d3
1 changed files with 5 additions and 1 deletions

View File

@ -441,11 +441,15 @@ BOOL WINAPI RedrawWindow( HWND hwnd, const RECT *rect, HRGN hrgn, UINT flags )
{
DWORD size;
RGNDATA *data = NULL;
static const RECT empty;
if (!(size = GetRegionData( hrgn, 0, NULL ))) return FALSE;
if (!(data = HeapAlloc( GetProcessHeap(), 0, size ))) return FALSE;
GetRegionData( hrgn, size, data );
ret = redraw_window_rects( hwnd, flags, (RECT *)data->Buffer, data->rdh.nCount );
if (!data->rdh.nCount) /* empty region -> use a single all-zero rectangle */
ret = redraw_window_rects( hwnd, flags, &empty, 1 );
else
ret = redraw_window_rects( hwnd, flags, (const RECT *)data->Buffer, data->rdh.nCount );
HeapFree( GetProcessHeap(), 0, data );
}