diff --git a/widget/src/mac/nsWindow.cpp b/widget/src/mac/nsWindow.cpp index d1ae523a29eb..0d9f7ede8f3d 100644 --- a/widget/src/mac/nsWindow.cpp +++ b/widget/src/mac/nsWindow.cpp @@ -87,6 +87,7 @@ inline void GetPortVisibleRegion(GrafPtr port, RgnHandle visRgn) #endif + //------------------------------------------------------------------------- // // nsWindow constructor @@ -409,8 +410,7 @@ NS_IMETHODIMP nsWindow::Enable(PRBool bState) //------------------------------------------------------------------------- NS_IMETHODIMP nsWindow::SetFocus(void) { - if (mToolkit) - ((nsToolkit*)mToolkit)->SetFocus(this); + gFocusHandler.SetFocus(this); return NS_OK; } @@ -1610,6 +1610,7 @@ PRBool nsWindow::RgnIntersects(RgnHandle aTheRegion, RgnHandle aIntersectRgn) * @param aY -- y offset amount * @return NOTHING */ + NS_IMETHODIMP nsWindow::CalcOffset(PRInt32 &aX,PRInt32 &aY) { aX = aY = 0; @@ -1713,7 +1714,8 @@ NS_IMETHODIMP nsWindow::WidgetToScreen(const nsRect& aLocalRect, nsRect& aGlobal // // Convert the local rect to global, except for this level. theParent->WidgetToScreen(aLocalRect, aGlobalRect); - + NS_RELEASE(theParent); + // the offset from our parent is in the x/y of our bounding rect nsRect myBounds; GetBounds(myBounds); @@ -1753,6 +1755,7 @@ NS_IMETHODIMP nsWindow::ScreenToWidget(const nsRect& aGlobalRect, nsRect& aLocal // // Convert the local rect to global, except for this level. theParent->WidgetToScreen(aGlobalRect, aLocalRect); + NS_RELEASE(theParent); // the offset from our parent is in the x/y of our bounding rect nsRect myBounds;