don't focus the parent of the window being closed if that parent is the hidden window. this reinstates rev 1.52, bug 22658. now bug 224058. r=ere, roc

This commit is contained in:
danm-moz%comcast.net 2003-11-07 02:13:32 +00:00
Родитель e73bfeb681
Коммит cf419872ca
1 изменённых файлов: 15 добавлений и 4 удалений

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

@ -466,10 +466,21 @@ NS_IMETHODIMP nsXULWindow::Destroy()
// We need to explicitly set the focus on Windows
nsCOMPtr<nsIBaseWindow> parent(do_QueryReferent(mParentWindow));
if (parent) {
nsCOMPtr<nsIWidget> parentWidget;
parent->GetMainWidget(getter_AddRefs(parentWidget));
if (parentWidget)
parentWidget->PlaceBehind(eZPlacementTop, 0, PR_TRUE);
nsCOMPtr<nsIBaseWindow> baseHiddenWindow;
if (appShell) {
nsCOMPtr<nsIXULWindow> hiddenWindow;
appShell->GetHiddenWindow(getter_AddRefs(hiddenWindow));
if (hiddenWindow)
baseHiddenWindow = do_GetInterface(hiddenWindow);
}
// somebody screwed up somewhere. hiddenwindow shouldn't be anybody's
// parent. still, when it happens, skip activating it.
if (baseHiddenWindow != parent) {
nsCOMPtr<nsIWidget> parentWidget;
parent->GetMainWidget(getter_AddRefs(parentWidget));
if (parentWidget)
parentWidget->PlaceBehind(eZPlacementTop, 0, PR_TRUE);
}
}
#endif