From 4f58f87771996fed8f16bc6db2bb83155686e9fa Mon Sep 17 00:00:00 2001 From: "hyatt%netscape.com" Date: Sat, 4 Nov 2000 09:33:20 +0000 Subject: [PATCH] Forgot a 54203 file. git-svn-id: svn://10.0.0.236/trunk@82315 18797224-902f-48f8-a5cc-f745e15eee43 --- .../xpfe/appshell/src/nsWebShellWindow.cpp | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp b/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp index c76f656ad4d..285f8e09cfc 100644 --- a/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp +++ b/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp @@ -79,7 +79,8 @@ static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID); #include "prlock.h" #include "nsIDOMXULDocument.h" -#include "nsIDOMXULCommandDispatcher.h" + +#include "nsIFocusController.h" #include "nsIDocumentViewer.h" #include "nsIDocument.h" @@ -532,20 +533,17 @@ nsWebShellWindow::HandleEvent(nsGUIEvent *aEvent) nsCOMPtr domDocument; nsCOMPtr domWindow; ((nsWebShellWindow *)data)->ConvertWebShellToDOMWindow(webShell, getter_AddRefs(domWindow)); - domWindow->GetDocument(getter_AddRefs(domDocument)); - nsCOMPtr xulDoc = do_QueryInterface(domDocument); - if (xulDoc) { - nsCOMPtr commandDispatcher; - xulDoc->GetCommandDispatcher(getter_AddRefs(commandDispatcher)); - if (commandDispatcher) { - nsCOMPtr focusedWindow; - commandDispatcher->GetFocusedWindow(getter_AddRefs(focusedWindow)); - if (focusedWindow) { - commandDispatcher->SetSuppressFocus(PR_TRUE); - domWindow->Focus(); // This sets focus, but we'll ignore it. - // A subsequent activate will cause us to stop suppressing. - break; - } + nsCOMPtr piWin(do_QueryInterface(domWindow)); + nsCOMPtr focusController; + piWin->GetRootFocusController(getter_AddRefs(focusController)); + if (focusController) { + nsCOMPtr focusedWindow; + focusController->GetFocusedWindow(getter_AddRefs(focusedWindow)); + if (focusedWindow) { + focusController->SetSuppressFocus(PR_TRUE); + domWindow->Focus(); // This sets focus, but we'll ignore it. + // A subsequent activate will cause us to stop suppressing. + break; } }