stifle infinite focus/activation recursion. bug 124299 r=hyatt,jst

git-svn-id: svn://10.0.0.236/trunk@113959 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
danm%netscape.com
2002-02-08 01:01:21 +00:00
parent fb25e83cb8
commit 6a157faf91
2 changed files with 10 additions and 0 deletions

View File

@@ -79,6 +79,7 @@ static NS_DEFINE_CID(kLookAndFeelCID, NS_LOOKANDFEEL_CID);
nsWebBrowser::nsWebBrowser() : mDocShellTreeOwner(nsnull),
mInitInfo(nsnull),
mContentType(typeContentWrapper),
mActivating(PR_FALSE),
mParentNativeWindow(nsnull),
mProgressListener(nsnull),
mBackgroundColor(0),
@@ -1605,6 +1606,13 @@ NS_IMETHODIMP nsWebBrowser::GetPrimaryContentWindow(nsIDOMWindowInternal **aDOMW
/* void activate (); */
NS_IMETHODIMP nsWebBrowser::Activate(void)
{
// stop infinite recursion from windows with onfocus handlers that
// reactivate the window
if (mActivating)
return NS_OK;
mActivating = PR_TRUE;
// try to set focus on the last focused window as stored in the
// focus controller object.
nsCOMPtr<nsIDOMWindow> domWindowExternal;
@@ -1664,6 +1672,7 @@ NS_IMETHODIMP nsWebBrowser::Activate(void)
}
}
mActivating = PR_FALSE;
return NS_OK;
}