diff --git a/widget/src/os2/nsWindow.cpp b/widget/src/os2/nsWindow.cpp index a3650669db13..4ec674c8d01a 100644 --- a/widget/src/os2/nsWindow.cpp +++ b/widget/src/os2/nsWindow.cpp @@ -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) diff --git a/widget/src/os2/nsWindow.h b/widget/src/os2/nsWindow.h index 8549a6fb409f..ebcd7ad4aac3 100644 --- a/widget/src/os2/nsWindow.h +++ b/widget/src/os2/nsWindow.h @@ -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 {