Bug 1977581 - Keep activating the parent window on Windows when destroying a child. r=win-reviewers,handyman, a=dsmith
Bug 1902315 removed a PlaceBehind call here, which in this case happened to also activate the window (via the aActivate = true parameter). Keep raising the window manually, but with simpler APIs. Differential Revision: https://phabricator.services.mozilla.com/D258743
This commit is contained in:
committed by
dsmith@mozilla.com
parent
78b1e3e8de
commit
5fe142be9a
@@ -547,6 +547,19 @@ NS_IMETHODIMP AppWindow::Destroy() {
|
||||
if (mWindow) mWindow->Show(false);
|
||||
#endif
|
||||
|
||||
// Raise and focus our parent explicitly on Windows, if visible. Apparently
|
||||
// Windows gets the z-order and focus wrong otherwise for nested modal
|
||||
// windows, see bug 1977581.
|
||||
#ifdef XP_WIN
|
||||
if (nsCOMPtr<nsIBaseWindow> parent = do_QueryReferent(mParentWindow)) {
|
||||
nsCOMPtr<nsIWidget> parentWidget;
|
||||
parent->GetMainWidget(getter_AddRefs(parentWidget));
|
||||
if (parentWidget && parentWidget->IsVisible()) {
|
||||
parentWidget->SetFocus(nsIWidget::Raise::Yes, dom::CallerType::System);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
RemoveTooltipSupport();
|
||||
|
||||
mDOMWindow = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user