Commit 6db71654 authored by Alexandre Julliard's avatar Alexandre Julliard

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

when the passed region was empty.
parent 7d92b5d8
......@@ -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 );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment