Bug 201242: When minimize and then restore, two carets appear in a mail compose window

Patch by bryner and me
r=bryner
sr=jst
a=sspitzer


git-svn-id: svn://10.0.0.236/trunk@141940 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
ere%atp.fi
2003-04-29 18:24:28 +00:00
parent c3c1158ca9
commit f9e595ea21

View File

@@ -105,7 +105,11 @@ nsFocusController::GetFocusedWindow(nsIDOMWindowInternal** aWindow)
NS_IMETHODIMP
nsFocusController::SetFocusedElement(nsIDOMElement* aElement)
{
mPreviousElement = mCurrentElement;
if (mCurrentElement)
mPreviousElement = mCurrentElement;
else if (aElement)
mPreviousElement = aElement;
mCurrentElement = aElement;
if (!mSuppressFocus) {
@@ -309,8 +313,10 @@ nsFocusController::Focus(nsIDOMEvent* aEvent)
nsCOMPtr<nsIDOMDocument> windowDoc;
mCurrentWindow->GetDocument(getter_AddRefs(windowDoc));
if (ownerDoc != windowDoc)
mCurrentElement = nsnull;
mCurrentElement = mPreviousElement = nsnull;
}
else
mPreviousElement = nsnull;
if (!mCurrentElement)
UpdateCommands(NS_LITERAL_STRING("focus"));