(resend) Scroll window fix
kumbayo84 at arcor.de
Sat Mar 3 17:53:11 CST 2007
On Tuesday 13 February 2007 14:38, Aric Stewart wrote:
> finds the case where the scrolling amount exceeds the window but still
> falls within the clipping rect. This generates an additional update
> region that needs to be invalidated.
> includes a test
I think your patch has a problem.
It calls CombineRgn with the deleted Region hrgnClip.
I don't know if it impacts real world applications, but i just saw a warning about a invalid handle
in my debug log.
Maybe moving DeleteObject below the if solves the problem?
I don't know...
@@ -870,6 +870,26 @@ INT WINAPI ScrollWindowEx( HWND hwnd, IN
CombineRgn( hrgnWinupd, hrgnWinupd, hrgnTemp, RGN_OR );
RedrawWindow( hwnd, NULL, hrgnTemp, rdw_flags);
DeleteObject( hrgnClip ); //<<<<<<< deleted here
+ /* Catch the case where the scolling amount exceeds the size of the
+ * original window. This generated a second update area that is the
+ * location where the original scrolled content would end up.
+ * This second region is not returned by the ScrollDC and sets
+ * ScrollWindowEx apart from just a ScrollDC.
+ * This has been verified with testing on windows.
+ if (abs(dx) > abs(rc.right - rc.left) ||
+ abs(dy) > abs(rc.bottom - rc.top))
+ DeleteObject( hrgnTemp );
+ hrgnTemp = CreateRectRgn(rc.left + dx, rc.top + dy, rc.right+dx, rc.bottom + dy);
+ CombineRgn( hrgnTemp, hrgnTemp, hrgnClip, RGN_AND ); //<<<<<<< used here
+ CombineRgn( hrgnUpdate, hrgnUpdate, hrgnTemp, RGN_OR );
+ if( !bOwnRgn)
+ CombineRgn( hrgnWinupd, hrgnWinupd, hrgnTemp, RGN_OR );
DeleteObject( hrgnTemp );
More information about the wine-devel