Fix for bug 259816: Browser steals focus from program selected in 'Open With' dialog

r=neil
sr=roc
This commit is contained in:
emaijala%kolumbus.fi 2006-05-22 18:35:56 +00:00
parent cb56ef4ec2
commit cd54a2cfe7

View File

@ -1710,8 +1710,13 @@ NS_METHOD nsWindow::Show(PRBool bState)
break;
default :
mode = SW_SHOWNORMAL;
// Don't take focus if the active window is not one of ours (e.g. bug 259816)
if (!GetNSWindowPtr(::GetForegroundWindow()))
mode = SW_SHOWNOACTIVATE;
}
::ShowWindow(mWnd, mode);
if (mode == SW_SHOWNOACTIVATE)
GetAttention(2);
} else {
DWORD flags = SWP_NOSIZE | SWP_NOMOVE | SWP_SHOWWINDOW;
if (mIsVisible)