Commit 4bb337fb authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

user32: Add clipping region tests on window resize.

parent 4a4d5a6f
......@@ -384,7 +384,7 @@ static void test_dc_visrgn(void)
static void test_begin_paint(void)
{
HDC old_hdc, hdc;
RECT rect, parent_rect;
RECT rect, parent_rect, client_rect;
PAINTSTRUCT ps;
COLORREF cr;
......@@ -401,6 +401,33 @@ static void test_begin_paint(void)
"invalid clip box %s\n", wine_dbgstr_rect( &rect ));
EndPaint( hwnd_cache, &ps );
SetWindowPos( hwnd_cache, 0, 0, 0, 100, 100, SWP_NOZORDER|SWP_NOMOVE|SWP_NOACTIVATE );
RedrawWindow( hwnd_cache, NULL, 0, RDW_VALIDATE|RDW_NOFRAME|RDW_NOERASE );
SetRect( &rect, 0, 0, 150, 150 );
RedrawWindow( hwnd_cache, &rect, 0, RDW_INVALIDATE|RDW_NOFRAME|RDW_NOERASE );
hdc = BeginPaint( hwnd_cache, &ps );
GetClipBox( hdc, &rect );
GetClientRect( hwnd_cache, &client_rect );
ok( EqualRect( &rect, &client_rect ), "clip box = %s, expected %s\n",
wine_dbgstr_rect( &rect ), wine_dbgstr_rect( &client_rect ));
SetWindowPos( hwnd_cache, 0, 0, 0, 200, 200, SWP_NOZORDER|SWP_NOMOVE|SWP_NOACTIVATE );
GetClipBox( hdc, &rect );
GetClientRect( hwnd_cache, &client_rect );
todo_wine ok( (!rect.left && !rect.top && rect.right == 150 && rect.bottom == 150) ||
broken( EqualRect( &rect, &client_rect )),
"clip box = %s\n", wine_dbgstr_rect( &rect ));
EndPaint( hwnd_cache, &ps );
SetWindowPos( hwnd_cache, 0, 0, 0, 100, 100, SWP_NOZORDER|SWP_NOMOVE|SWP_NOACTIVATE );
RedrawWindow( hwnd_cache, NULL, 0, RDW_INVALIDATE|RDW_NOFRAME|RDW_NOERASE );
hdc = BeginPaint( hwnd_cache, &ps );
SetWindowPos( hwnd_cache, 0, 0, 0, 200, 200, SWP_NOZORDER|SWP_NOMOVE|SWP_NOACTIVATE );
GetClipBox( hdc, &rect );
GetClientRect( hwnd_cache, &client_rect );
todo_wine ok( EqualRect( &rect, &client_rect ), "clip box = %s, expected %s\n",
wine_dbgstr_rect( &rect ), wine_dbgstr_rect( &client_rect ));
EndPaint( hwnd_cache, &ps );
/* window DC */
RedrawWindow( hwnd_owndc, NULL, 0, RDW_VALIDATE|RDW_NOFRAME|RDW_NOERASE );
......@@ -440,6 +467,21 @@ static void test_begin_paint(void)
ok( !(rect.left >= 10 && rect.top >= 10 && rect.right <= 20 && rect.bottom <= 20),
"clip box should still be the whole window %s\n", wine_dbgstr_rect( &rect ));
SetWindowPos( hwnd_owndc, 0, 0, 0, 100, 100, SWP_NOZORDER|SWP_NOMOVE|SWP_NOACTIVATE );
RedrawWindow( hwnd_owndc, NULL, 0, RDW_VALIDATE|RDW_NOFRAME|RDW_NOERASE );
SetRect( &rect, 0, 0, 50, 50 );
RedrawWindow( hwnd_owndc, &rect, 0, RDW_INVALIDATE|RDW_ERASE );
hdc = BeginPaint( hwnd_owndc, &ps );
GetClipBox( hdc, &rect );
ok( !rect.left && !rect.top && rect.right == 50 && rect.bottom == 50,
"clip box = %s\n", wine_dbgstr_rect( &rect ));
SetWindowPos( hwnd_owndc, 0, 0, 0, 200, 200, SWP_NOZORDER|SWP_NOMOVE|SWP_NOACTIVATE );
GetClipBox( hdc, &rect );
GetClientRect( hwnd_owndc, &client_rect );
ok( EqualRect( &rect, &client_rect ), "clip box = %s, expected %s\n",
wine_dbgstr_rect( &rect ), wine_dbgstr_rect( &client_rect ));
EndPaint( hwnd_owndc, &ps );
/* class DC */
RedrawWindow( hwnd_classdc, NULL, 0, RDW_VALIDATE|RDW_NOFRAME|RDW_NOERASE );
......
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