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;
|
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
|
void
|
||||||
nsWindow::Scroll(const nsIntPoint& aDelta,
|
nsWindow::Scroll(const nsIntPoint& aDelta,
|
||||||
const nsTArray<nsIntRect>& aDestRects,
|
const nsTArray<nsIntRect>& aDestRects,
|
||||||
|
|
@ -2362,7 +2385,11 @@ nsWindow::Scroll(const nsIntPoint& aDelta,
|
||||||
// it.
|
// it.
|
||||||
::SetRectRgn(destRgn, destRect.x, destRect.y, destRect.XMost(), destRect.YMost());
|
::SetRectRgn(destRgn, destRect.x, destRect.y, destRect.XMost(), destRect.YMost());
|
||||||
::CombineRgn(updateRgn, updateRgn, destRgn, RGN_AND);
|
::CombineRgn(updateRgn, updateRgn, destRgn, RGN_AND);
|
||||||
::InvalidateRgn(mWnd, updateRgn, FALSE);
|
if (flags & SW_SCROLLCHILDREN) {
|
||||||
|
InvalidateRgnInWindowSubtree(mWnd, updateRgn, destRgn);
|
||||||
|
} else {
|
||||||
|
::InvalidateRgn(mWnd, updateRgn, FALSE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
::DeleteObject((HGDIOBJ)updateRgn);
|
::DeleteObject((HGDIOBJ)updateRgn);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue