Command dispatcher fix for PDT+ focus issues on Linux. r=saari

This commit is contained in:
hyatt%netscape.com 2000-02-09 01:32:42 +00:00
Родитель f2d270331a
Коммит 28745243d6
2 изменённых файлов: 22 добавлений и 0 удалений

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

@ -373,6 +373,17 @@ nsXULCommandDispatcher::Focus(nsIDOMEvent* aEvent)
GetParentWindowFromDocument(domDoc, getter_AddRefs(domWindow));
if (domWindow && (domWindow != mCurrentWindow)) {
SetFocusedWindow(domWindow);
if (mCurrentElement) {
// Make sure this element is in our window. If not, we
// should clear this field.
nsCOMPtr<nsIDOMDocument> ownerDoc;
mCurrentElement->GetOwnerDocument(getter_AddRefs(ownerDoc));
nsCOMPtr<nsIDOMDocument> windowDoc;
mCurrentWindow->GetDocument(getter_AddRefs(windowDoc));
if (ownerDoc == windowDoc.get())
mCurrentElement = nsnull;
}
if (!mCurrentElement)
UpdateCommands(nsAutoString("focus"));
}

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

@ -373,6 +373,17 @@ nsXULCommandDispatcher::Focus(nsIDOMEvent* aEvent)
GetParentWindowFromDocument(domDoc, getter_AddRefs(domWindow));
if (domWindow && (domWindow != mCurrentWindow)) {
SetFocusedWindow(domWindow);
if (mCurrentElement) {
// Make sure this element is in our window. If not, we
// should clear this field.
nsCOMPtr<nsIDOMDocument> ownerDoc;
mCurrentElement->GetOwnerDocument(getter_AddRefs(ownerDoc));
nsCOMPtr<nsIDOMDocument> windowDoc;
mCurrentWindow->GetDocument(getter_AddRefs(windowDoc));
if (ownerDoc == windowDoc.get())
mCurrentElement = nsnull;
}
if (!mCurrentElement)
UpdateCommands(nsAutoString("focus"));
}