mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-31 12:19:49 +00:00
Calling ValidateRect or ValidateRgn on a windows also validates the
children. Add a test to show the behavior.
This commit is contained in:
parent
654a00415d
commit
8417d41a24
2 changed files with 40 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue