forked from mirrors/gecko-dev
Bug 532404. If SW_SCROLLCHILDREN was used, invalidate the region in all descendant windows as well. r=jmathies
This commit is contained in:
parent
5c87a2d633
commit
d949a0c5f6
1 changed files with 28 additions and 1 deletions
|
|
@ -2227,6 +2227,29 @@ HasDescendantWindowOutsideRect(DWORD aThisThreadID, HWND aWnd,
|
|||
return PR_FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
InvalidateRgnInWindowSubtree(HWND aWnd, HRGN aRgn, HRGN aTmpRgn)
|
||||
{
|
||||
RECT clientRect;
|
||||
::GetClientRect(aWnd, &clientRect);
|
||||
::SetRectRgn(aTmpRgn, clientRect.left, clientRect.top,
|
||||
clientRect.right, clientRect.bottom);
|
||||
if (::CombineRgn(aTmpRgn, aTmpRgn, aRgn, RGN_AND) == NULLREGION) {
|
||||
return;
|
||||
}
|
||||
|
||||
::InvalidateRgn(aWnd, aTmpRgn, FALSE);
|
||||
|
||||
for (HWND child = ::GetWindow(aWnd, GW_CHILD); child;
|
||||
child = ::GetWindow(child, GW_HWNDNEXT)) {
|
||||
POINT pt = { 0, 0 };
|
||||
::MapWindowPoints(child, aWnd, &pt, 1);
|
||||
::OffsetRgn(aRgn, -pt.x, -pt.y);
|
||||
InvalidateRgnInWindowSubtree(child, aRgn, aTmpRgn);
|
||||
::OffsetRgn(aRgn, pt.x, pt.y);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsWindow::Scroll(const nsIntPoint& aDelta,
|
||||
const nsTArray<nsIntRect>& aDestRects,
|
||||
|
|
@ -2362,8 +2385,12 @@ nsWindow::Scroll(const nsIntPoint& aDelta,
|
|||
// it.
|
||||
::SetRectRgn(destRgn, destRect.x, destRect.y, destRect.XMost(), destRect.YMost());
|
||||
::CombineRgn(updateRgn, updateRgn, destRgn, RGN_AND);
|
||||
if (flags & SW_SCROLLCHILDREN) {
|
||||
InvalidateRgnInWindowSubtree(mWnd, updateRgn, destRgn);
|
||||
} else {
|
||||
::InvalidateRgn(mWnd, updateRgn, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
::DeleteObject((HGDIOBJ)updateRgn);
|
||||
::DeleteObject((HGDIOBJ)destRgn);
|
||||
|
|
|
|||
Loading…
Reference in a new issue