From 44cc4c2ad521e9fc50aa93f855101ca152a558a9 Mon Sep 17 00:00:00 2001 From: narzoul Date: Mon, 18 Apr 2016 22:32:27 +0200 Subject: [PATCH] Disabled smooth scrolling Prevents a visual artifact where the area that is supposed to scroll out of view remains static during the smooth scrolling animation. --- DDrawCompat/CompatGdiScrollFunctions.cpp | 26 ++++++++++-------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/DDrawCompat/CompatGdiScrollFunctions.cpp b/DDrawCompat/CompatGdiScrollFunctions.cpp index 08d7a1f..292a1cf 100644 --- a/DDrawCompat/CompatGdiScrollFunctions.cpp +++ b/DDrawCompat/CompatGdiScrollFunctions.cpp @@ -6,12 +6,8 @@ namespace { - BOOL WINAPI scrollWindow( - _In_ HWND hWnd, - _In_ int XAmount, - _In_ int YAmount, - _In_ const RECT *lpRect, - _In_ const RECT *lpClipRect) + BOOL WINAPI scrollWindow(HWND hWnd, int XAmount, int YAmount, + const RECT* lpRect, const RECT* lpClipRect) { Compat::LogEnter("scrollWindow", hWnd, XAmount, YAmount, lpRect, lpClipRect); BOOL result = CALL_ORIG_FUNC(ScrollWindow)(hWnd, XAmount, YAmount, lpRect, lpClipRect); @@ -23,24 +19,24 @@ namespace return result; } - int WINAPI scrollWindowEx( - _In_ HWND hWnd, - _In_ int dx, - _In_ int dy, - _In_ const RECT *prcScroll, - _In_ const RECT *prcClip, - _In_ HRGN hrgnUpdate, - _Out_ LPRECT prcUpdate, - _In_ UINT flags) + int WINAPI scrollWindowEx(HWND hWnd, int dx, int dy, const RECT* prcScroll, const RECT* prcClip, + HRGN hrgnUpdate, LPRECT prcUpdate, UINT flags) { Compat::LogEnter("scrollWindowEx", hWnd, dx, dy, prcScroll, prcClip, hrgnUpdate, prcUpdate, flags); + + if (flags & SW_SMOOTHSCROLL) + { + flags = LOWORD(flags ^ SW_SMOOTHSCROLL); + } + int result = CALL_ORIG_FUNC(ScrollWindowEx)( hWnd, dx, dy, prcScroll, prcClip, hrgnUpdate, prcUpdate, flags); if (ERROR != result) { CompatGdiScrollFunctions::updateScrolledWindow(hWnd); } + Compat::LogLeave("scrollWindowEx", hWnd, dx, dy, prcScroll, prcClip, hrgnUpdate, prcUpdate, flags) << result; return result;