From e71dbbe6f4fd8adce095a402451f9c1338b3a508 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Sat, 6 Oct 2012 02:36:46 +0000 Subject: [PATCH] =?utf8?q?[NtUser]=20-=20Tested=20wine=20win=20test=5Fscro?= =?utf8?q?llwindow,=20test=5Fscrollvalidate,=20test=5Fscrolldc,=20and=20te?= =?utf8?q?st=5Fscroll=20plus=20ReactOS=20API=20tests.=20Pass=20all=20but?= =?utf8?q?=20three=20region=20tests=20in=20test=5Fscrollvalidate.=20-=20De?= =?utf8?q?dicated=20to=20V=C3=ADctor=20Mart=C3=ADnez=20Calvo.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit svn path=/trunk/; revision=57491 --- reactos/win32ss/user/ntuser/painting.c | 29 +++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/reactos/win32ss/user/ntuser/painting.c b/reactos/win32ss/user/ntuser/painting.c index 57506a6e6f0..24ad58eb029 100644 --- a/reactos/win32ss/user/ntuser/painting.c +++ b/reactos/win32ss/user/ntuser/painting.c @@ -1611,9 +1611,11 @@ NtUserScrollWindowEx( INT Result; PWND Window = NULL, CaretWnd; HDC hDC; - HRGN hrgnOwn = NULL, hrgnTemp; + HRGN hrgnOwn = NULL, hrgnTemp, hrgnWinupd = NULL; HWND hwndCaret; DWORD dcxflags = 0; + int rdw_flags; + BOOL bOwnRgn = TRUE; NTSTATUS Status = STATUS_SUCCESS; DECLARE_RETURN(DWORD); USER_REFERENCE_ENTRY Ref, CaretRef; @@ -1666,7 +1668,10 @@ NtUserScrollWindowEx( } if (hrgnUpdate) + { hrgnOwn = hrgnUpdate; + bOwnRgn = FALSE; + } else hrgnOwn = IntSysCreateRectRgn(0, 0, 0, 0); @@ -1695,6 +1700,8 @@ NtUserScrollWindowEx( RETURN(ERROR); } + rdw_flags = (flags & SW_ERASE) && (flags & SW_INVALIDATE) ? RDW_INVALIDATE | RDW_ERASE : RDW_INVALIDATE ; + rcCaret = rcScroll; hwndCaret = co_IntFixCaret(Window, &rcCaret, flags); @@ -1710,16 +1717,22 @@ NtUserScrollWindowEx( /* * Take into account the fact that some damage may have occurred during - * the scroll. + * the scroll. Keep a copy in hrgnWinupd to be added to hrngUpdate at the end. */ hrgnTemp = IntSysCreateRectRgn(0, 0, 0, 0); if (co_UserGetUpdateRgn(Window, hrgnTemp, FALSE) != NULLREGION) { HRGN hrgnClip = IntSysCreateRectRgnIndirect(&rcClip); + if (!bOwnRgn) + { + hrgnWinupd = IntSysCreateRectRgn( 0, 0, 0, 0); + NtGdiCombineRgn( hrgnWinupd, hrgnTemp, 0, RGN_COPY); + } NtGdiOffsetRgn(hrgnTemp, dx, dy); NtGdiCombineRgn(hrgnTemp, hrgnTemp, hrgnClip, RGN_AND); - co_UserRedrawWindow(Window, NULL, hrgnTemp, RDW_INVALIDATE | RDW_ERASE); + if (!bOwnRgn) NtGdiCombineRgn( hrgnWinupd, hrgnWinupd, hrgnTemp, RGN_OR ); + co_UserRedrawWindow(Window, NULL, hrgnTemp, rdw_flags ); GreDeleteObject(hrgnClip); } GreDeleteObject(hrgnTemp); @@ -1746,7 +1759,7 @@ NtUserScrollWindowEx( UserRefObjectCo(Child, &WndRef); co_WinPosSetWindowPos(Child, 0, rcChild.left + dx, rcChild.top + dy, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE | - SWP_NOREDRAW); + SWP_NOREDRAW | SWP_DEFERERASE); UserDerefObjectCo(Child); } } @@ -1754,7 +1767,7 @@ NtUserScrollWindowEx( if (flags & (SW_INVALIDATE | SW_ERASE)) { - co_UserRedrawWindow(Window, NULL, hrgnOwn, RDW_INVALIDATE | RDW_ERASE | + co_UserRedrawWindow(Window, NULL, hrgnOwn, rdw_flags | ((flags & SW_ERASE) ? RDW_ERASENOW : 0) | ((flags & SW_SCROLLCHILDREN) ? RDW_ALLCHILDREN : 0)); } @@ -1793,6 +1806,12 @@ NtUserScrollWindowEx( RETURN(Result); CLEANUP: + if (hrgnWinupd && !bOwnRgn) + { + NtGdiCombineRgn( hrgnOwn, hrgnOwn, hrgnWinupd, RGN_OR); + GreDeleteObject(hrgnWinupd); + } + if (hrgnOwn && !hrgnUpdate) { GreDeleteObject(hrgnOwn); -- 2.17.1