From eb33840de624681eb7337ad50aba2516fb8d37e3 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Thu, 13 Sep 2012 01:22:33 +0000 Subject: [PATCH] [Win32SS] - Based on wine Alexandre Julliard: ScrollWindow should not use a cached DC, unlike ScrollWindowEx. svn path=/trunk/; revision=57290 --- reactos/win32ss/user/ntuser/painting.c | 21 +++++++++++++++++++- reactos/win32ss/user/user32/windows/window.c | 8 +++++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/reactos/win32ss/user/ntuser/painting.c b/reactos/win32ss/user/ntuser/painting.c index 8007e3d0c3c..57506a6e6f0 100644 --- a/reactos/win32ss/user/ntuser/painting.c +++ b/reactos/win32ss/user/ntuser/painting.c @@ -1613,6 +1613,7 @@ NtUserScrollWindowEx( HDC hDC; HRGN hrgnOwn = NULL, hrgnTemp; HWND hwndCaret; + DWORD dcxflags = 0; NTSTATUS Status = STATUS_SUCCESS; DECLARE_RETURN(DWORD); USER_REFERENCE_ENTRY Ref, CaretRef; @@ -1669,7 +1670,25 @@ NtUserScrollWindowEx( else hrgnOwn = IntSysCreateRectRgn(0, 0, 0, 0); - hDC = UserGetDCEx(Window, 0, DCX_CACHE | DCX_USESTYLE); + /* ScrollWindow uses the window DC, ScrollWindowEx doesn't */ + if (flags & SW_SCROLLWNDDCE) + { + dcxflags = DCX_USESTYLE; + + if (!(Window->pcls->style & (CS_OWNDC|CS_CLASSDC))) + dcxflags |= DCX_CACHE; // AH??? wine~ If not Powned or with Class go Cheap! + + if (flags & SW_SCROLLCHILDREN && Window->style & WS_CLIPCHILDREN) + dcxflags |= DCX_CACHE|DCX_NOCLIPCHILDREN; + } + else + { + /* So in this case ScrollWindowEx uses Cache DC. */ + dcxflags = DCX_CACHE|DCX_USESTYLE; + if (flags & SW_SCROLLCHILDREN) dcxflags |= DCX_NOCLIPCHILDREN; + } + + hDC = UserGetDCEx(Window, 0, dcxflags); if (!hDC) { /* FIXME: SetLastError? */ diff --git a/reactos/win32ss/user/user32/windows/window.c b/reactos/win32ss/user/user32/windows/window.c index 53ed882e6a2..a26080702c5 100644 --- a/reactos/win32ss/user/user32/windows/window.c +++ b/reactos/win32ss/user/user32/windows/window.c @@ -1900,9 +1900,10 @@ ScrollWindow(HWND hWnd, prcClip, 0, NULL, - (lpRect ? 0 : SW_SCROLLCHILDREN) | SW_INVALIDATE) != ERROR; + (lpRect ? 0 : SW_SCROLLCHILDREN) | (SW_ERASE|SW_INVALIDATE|SW_SCROLLWNDDCE)) != ERROR; } +/* ScrollWindow uses the window DC, ScrollWindowEx doesn't */ /* * @implemented @@ -1917,6 +1918,11 @@ ScrollWindowEx(HWND hWnd, LPRECT prcUpdate, UINT flags) { + if (flags & SW_SMOOTHSCROLL) + { + FIXME("SW_SMOOTHSCROLL not supported."); + // Fall through.... + } return NtUserScrollWindowEx(hWnd, dx, dy,