mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
deactivate root focus controller as well as your own while deactivating yourself. bug 122462 / bugscape 11864 code=saari,myself r=bryner,hyatt
This commit is contained in:
parent
b4360dcc6c
commit
87998027b0
@ -1662,26 +1662,31 @@ NS_IMETHODIMP nsWebBrowser::Activate(void)
|
|||||||
/* void deactivate (); */
|
/* void deactivate (); */
|
||||||
NS_IMETHODIMP nsWebBrowser::Deactivate(void)
|
NS_IMETHODIMP nsWebBrowser::Deactivate(void)
|
||||||
{
|
{
|
||||||
/* At this time we don't clear mWWatch's ActiveWindow; we just allow
|
/* At this time we don't clear mWWatch's ActiveWindow; we just allow
|
||||||
the presumed other newly active window to set it when it comes in.
|
the presumed other newly active window to set it when it comes in.
|
||||||
This seems harmless and maybe safer, but we have no real evidence
|
This seems harmless and maybe safer, but we have no real evidence
|
||||||
either way just yet. */
|
either way just yet. */
|
||||||
|
|
||||||
NS_ENSURE_STATE(mDocShell);
|
|
||||||
nsCOMPtr<nsIPresShell> presShell;
|
|
||||||
mDocShell->GetPresShell(getter_AddRefs(presShell));
|
|
||||||
if(!presShell)
|
|
||||||
return NS_OK;
|
|
||||||
|
|
||||||
nsCOMPtr<nsIDOMWindow> domWindow;
|
|
||||||
GetContentDOMWindow(getter_AddRefs(domWindow));
|
|
||||||
if (domWindow) {
|
|
||||||
nsCOMPtr<nsPIDOMWindow> privateDOMWindow = do_QueryInterface(domWindow);
|
|
||||||
if(privateDOMWindow)
|
|
||||||
privateDOMWindow->Deactivate();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
NS_ENSURE_STATE(mDocShell);
|
||||||
|
nsCOMPtr<nsIPresShell> presShell;
|
||||||
|
mDocShell->GetPresShell(getter_AddRefs(presShell));
|
||||||
|
if(!presShell)
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
||||||
|
nsCOMPtr<nsIDOMWindow> domWindow;
|
||||||
|
GetContentDOMWindow(getter_AddRefs(domWindow));
|
||||||
|
if (domWindow) {
|
||||||
|
nsCOMPtr<nsPIDOMWindow> privateDOMWindow = do_QueryInterface(domWindow);
|
||||||
|
if(privateDOMWindow) {
|
||||||
|
nsCOMPtr<nsIFocusController> focusController;
|
||||||
|
privateDOMWindow->GetRootFocusController(getter_AddRefs(focusController));
|
||||||
|
if (focusController)
|
||||||
|
focusController->SetActive(PR_FALSE);
|
||||||
|
privateDOMWindow->Deactivate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* void setFocusAtFirstElement (); */
|
/* void setFocusAtFirstElement (); */
|
||||||
|
@ -542,8 +542,13 @@ nsWebShellWindow::HandleEvent(nsGUIEvent *aEvent)
|
|||||||
else */
|
else */
|
||||||
if (domWindow) {
|
if (domWindow) {
|
||||||
nsCOMPtr<nsPIDOMWindow> privateDOMWindow = do_QueryInterface(domWindow);
|
nsCOMPtr<nsPIDOMWindow> privateDOMWindow = do_QueryInterface(domWindow);
|
||||||
if(privateDOMWindow)
|
if(privateDOMWindow) {
|
||||||
|
nsCOMPtr<nsIFocusController> focusController;
|
||||||
|
privateDOMWindow->GetRootFocusController(getter_AddRefs(focusController));
|
||||||
|
if (focusController)
|
||||||
|
focusController->SetActive(PR_FALSE);
|
||||||
privateDOMWindow->Deactivate();
|
privateDOMWindow->Deactivate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user