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
This commit is contained in:
ere%atp.fi 2003-04-29 18:24:28 +00:00
parent 36492d4f25
commit abb7fc1211

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