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
Родитель 893f0738a2
Коммит f34440c5b9
1 изменённых файлов: 8 добавлений и 2 удалений

Просмотреть файл

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