From 7bad112096441090cd844233f266bba40c6a9f06 Mon Sep 17 00:00:00 2001 From: "pinkerton%netscape.com" Date: Tue, 9 Sep 2003 21:09:22 +0000 Subject: [PATCH] check if there is an active focus controller before sending the blur (r=pink/sr=bryner/a=brendan) bug 198153 --- content/events/src/nsEventStateManager.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/content/events/src/nsEventStateManager.cpp b/content/events/src/nsEventStateManager.cpp index 61051770fcb..a25bbaec18e 100644 --- a/content/events/src/nsEventStateManager.cpp +++ b/content/events/src/nsEventStateManager.cpp @@ -3972,9 +3972,18 @@ nsEventStateManager::SetContentState(nsIContent *aContent, PRInt32 aState) aContent = nsnull; } } else { + // see comments in ShiftFocusInternal on mCurrentFocus overloading + PRBool fcActive = PR_FALSE; + if (mDocument) { + nsCOMPtr fc; + fc = getter_AddRefs(GetFocusControllerForDocument(mDocument)); + if (fc) + fc->GetActive(&fcActive); + } notifyContent[3] = gLastFocusedContent; NS_IF_ADDREF(gLastFocusedContent); - SendFocusBlur(mPresContext, aContent, PR_TRUE); + // only raise window if the the focus controller is active + SendFocusBlur(mPresContext, aContent, fcActive); } }