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); } }