Commit 8417d41a authored by Rein Klazes's avatar Rein Klazes Committed by Alexandre Julliard

Calling ValidateRect or ValidateRgn on a windows also validates the

children. Add a test to show the behavior.
parent 654a0041
......@@ -492,7 +492,7 @@ BOOL WINAPI InvalidateRect( HWND hwnd, const RECT *rect, BOOL erase )
*/
BOOL WINAPI ValidateRgn( HWND hwnd, HRGN hrgn )
{
return RedrawWindow( hwnd, NULL, hrgn, RDW_VALIDATE | RDW_NOCHILDREN );
return RedrawWindow( hwnd, NULL, hrgn, RDW_VALIDATE );
}
......@@ -501,7 +501,7 @@ BOOL WINAPI ValidateRgn( HWND hwnd, HRGN hrgn )
*/
BOOL WINAPI ValidateRect( HWND hwnd, const RECT *rect )
{
return RedrawWindow( hwnd, rect, 0, RDW_VALIDATE | RDW_NOCHILDREN );
return RedrawWindow( hwnd, rect, 0, RDW_VALIDATE );
}
......
......@@ -2194,6 +2194,43 @@ static void test_mouse_input(HWND hwnd)
DestroyWindow(popup);
}
static void test_validatergn(HWND hwnd)
{
HWND child;
RECT rc, rc2;
HRGN rgn;
int ret;
child = CreateWindowExA(0, "static", NULL, WS_CHILD| WS_VISIBLE, 10, 10, 10, 10, hwnd, 0, 0, NULL);
ShowWindow(hwnd, SW_SHOW);
UpdateWindow( hwnd);
/* test that ValidateRect validates children*/
InvalidateRect( child, NULL, 1);
GetWindowRect( child, &rc);
MapWindowPoints( NULL, hwnd, (POINT*) &rc, 2);
ret = GetUpdateRect( child, &rc2, 0);
ok( rc2.right > rc2.left && rc2.bottom > rc2.top,
"Update rectangle is empty!\n");
ValidateRect( hwnd, &rc);
ret = GetUpdateRect( child, &rc2, 0);
ok( rc2.left == 0 && rc2.top == 0 && rc2.right == 0 && rc2.bottom == 0,
"Update rectangle %ld,%ld-%ld,%ld is not empty!\n", rc2.left, rc2.top,
rc2.right, rc2.bottom);
/* now test ValidateRgn */
InvalidateRect( child, NULL, 1);
GetWindowRect( child, &rc);
MapWindowPoints( NULL, hwnd, (POINT*) &rc, 2);
rgn = CreateRectRgnIndirect( &rc);
ValidateRgn( hwnd, rgn);
ret = GetUpdateRect( child, &rc2, 0);
ok( rc2.left == 0 && rc2.top == 0 && rc2.right == 0 && rc2.bottom == 0,
"Update rectangle %ld,%ld-%ld,%ld is not empty!\n", rc2.left, rc2.top,
rc2.right, rc2.bottom);
DeleteObject( rgn);
DestroyWindow( child );
}
START_TEST(win)
{
pGetAncestor = (void *)GetProcAddress( GetModuleHandleA("user32.dll"), "GetAncestor" );
......@@ -2249,6 +2286,7 @@ START_TEST(win)
test_children_zorder(hwndMain);
test_keyboard_input(hwndMain);
test_mouse_input(hwndMain);
test_validatergn(hwndMain);
UnhookWindowsHookEx(hhook);
}
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