win32 only fix for 82534. focus goes wonky after minimizing a window. r=bryner, sr=jag

git-svn-id: svn://10.0.0.236/trunk@123675 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
saari%netscape.com
2002-06-20 04:55:13 +00:00
parent 92d37b3380
commit eecbbc3392
5 changed files with 53 additions and 0 deletions

View File

@@ -450,6 +450,25 @@ nsWebShellWindow::HandleEvent(nsGUIEvent *aEvent)
// the state and pass the event on to the OS. The day is coming
// when we'll handle the event here, and the return result will
// then need to be different.
#ifdef XP_WIN
// This is a nasty hack to get around the fact that win32 sends the kill focus
// event in a different sequence than the deactivate depending on if you're
// minimizing the window vs. just clicking in a different window to cause
// the deactivation. Bug #82534
if(modeEvent->mSizeMode = nsSizeMode_Minimized) {
nsCOMPtr<nsIDOMWindowInternal> domWindow;
eventWindow->ConvertWebShellToDOMWindow(webShell, getter_AddRefs(domWindow));
if (domWindow) {
nsCOMPtr<nsPIDOMWindow> privateDOMWindow = do_QueryInterface(domWindow);
if(privateDOMWindow) {
nsCOMPtr<nsIFocusController> focusController;
privateDOMWindow->GetRootFocusController(getter_AddRefs(focusController));
if (focusController)
focusController->RewindFocusState();
}
}
}
#endif
break;
}
case NS_OS_TOOLBAR: {