mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-03 20:49:27 +00:00
FIx for bug 109081. Do not try to activate or set the focus on a disabled window. R=rods, SR=alecf, A=asa
This commit is contained in:
parent
7c3c087416
commit
7bf3bef1da
@ -2063,6 +2063,13 @@ GlobalWindowImpl::Focus()
|
||||
nsCOMPtr<nsIBaseWindow> treeOwnerAsWin;
|
||||
GetTreeOwner(getter_AddRefs(treeOwnerAsWin));
|
||||
if (treeOwnerAsWin) {
|
||||
PRBool isEnabled = PR_TRUE;
|
||||
treeOwnerAsWin->GetEnabled(&isEnabled);
|
||||
if (!isEnabled) {
|
||||
NS_WARNING( "Should not try to set the focus on a disabled window" );
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
treeOwnerAsWin->SetVisibility(PR_TRUE);
|
||||
nsCOMPtr<nsIEmbeddingSiteWindow> embeddingWin(do_GetInterface(treeOwnerAsWin));
|
||||
if (embeddingWin)
|
||||
@ -3413,8 +3420,16 @@ GlobalWindowImpl::Activate()
|
||||
*/
|
||||
nsCOMPtr<nsIBaseWindow> treeOwnerAsWin;
|
||||
GetTreeOwner(getter_AddRefs(treeOwnerAsWin));
|
||||
if (treeOwnerAsWin)
|
||||
if (treeOwnerAsWin) {
|
||||
PRBool isEnabled = PR_TRUE;
|
||||
treeOwnerAsWin->GetEnabled(&isEnabled);
|
||||
if (!isEnabled) {
|
||||
NS_WARNING( "Should not try to activate a disabled window" );
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
treeOwnerAsWin->SetVisibility(PR_TRUE);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIPresShell> presShell;
|
||||
mDocShell->GetPresShell(getter_AddRefs(presShell));
|
||||
|
Loading…
x
Reference in New Issue
Block a user