mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
Fixed #14416 "GFX combo boxes cause zombie windows": there was a memory leak in WidgetToScreen and ScreenToWidget. r=dcone/sfraser
This commit is contained in:
parent
8c4468746e
commit
675acb9003
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user