[OS/2] Bug 400329: work around hover position mismatch after scrolling on pages with iframes, r=mkaply

This commit is contained in:
mozilla@weilbacher.org 2008-05-02 13:49:18 -07:00
parent 97fcb884ad
commit 7fc2598eda
2 changed files with 23 additions and 6 deletions

View File

@ -2228,6 +2228,21 @@ BOOL nsWindow::NotifyForeignChildWindows(HWND aWnd)
return WinEndEnumWindows(hEnum);
}
//-------------------------------------------------------------------------
//
// Force a resize of child windows after a scroll to reset hover positions.
//
//-------------------------------------------------------------------------
void nsWindow::ScrollChildWindows(PRInt32 aX, PRInt32 aY)
{
nsIWidget *child = GetFirstChild();
while (child) {
nsRect rect;
child->GetBounds(rect);
child->Resize(rect.x + aX, rect.y + aY, rect.width, rect.height, PR_FALSE);
child = child->GetNextSibling();
}
}
//-------------------------------------------------------------------------
//
// Scroll the bits of a window
@ -2244,19 +2259,20 @@ NS_METHOD nsWindow::Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect)
rcl.yBottom = aClipRect->y + aClipRect->height;
rcl.xRight = rcl.xLeft + aClipRect->width;
rcl.yTop = rcl.yBottom + aClipRect->height;
NS2PM( rcl);
NS2PM(rcl);
// this rect is inex
}
// this prevents screen corruption while scrolling during a
// Moz-originated drag - during a native drag, the screen
// isn't updated until the drag ends. so there's no corruption
// this prevents screen corruption while scrolling during a
// Moz-originated drag - during a native drag, the screen
// isn't updated until the drag ends. so there's no corruption
HPS hps = 0;
CheckDragStatus(ACTION_SCROLL, &hps);
NotifyForeignChildWindows(mWnd);
WinScrollWindow( mWnd, aDx, -aDy, aClipRect ? &rcl : 0, 0, 0,
0, SW_SCROLLCHILDREN | SW_INVALIDATERGN);
WinScrollWindow(mWnd, aDx, -aDy, aClipRect ? &rcl : 0, 0, 0,
0, SW_SCROLLCHILDREN | SW_INVALIDATERGN);
ScrollChildWindows(aDx, aDy);
Update();
if (hps)

View File

@ -331,6 +331,7 @@ protected:
PRUint32 aWidth, PRUint32 aHeight);
BOOL NotifyForeignChildWindows(HWND aWnd);
void ScrollChildWindows(PRInt32 aX, PRInt32 aY);
// Enumeration of the methods which are accessible on the PM thread
enum {