зеркало из https://github.com/mozilla/pjs.git
Command dispatcher fix for PDT+ focus issues on Linux. r=saari
This commit is contained in:
Родитель
f2d270331a
Коммит
28745243d6
|
@ -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"));
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче