This check-in fixes a long standing problem of not being able to use any

keyboard controls on the embedded browser.  Next step is to re-activate
the keyboard listener features.

M webclient/src_moz/EmbedProgress.cpp

- call TopLevelFocusIn to make sure we get the input focus

M webclient/src_moz/NativeBrowserControl.cpp
M webclient/src_moz/NativeBrowserControl.h

- copy TopLevelFocus{In,Out}() from EmbedPrivate.


git-svn-id: svn://10.0.0.236/trunk@165083 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
edburns%acm.org
2004-11-07 15:29:10 +00:00
parent 1ab6c4beb7
commit cedb5aa9fa
3 changed files with 45 additions and 0 deletions

View File

@@ -45,6 +45,9 @@
#include <nsIDOMWindowInternal.h>
#include <nsIChromeEventHandler.h>
// for the focus hacking we need to do
#include <nsIFocusController.h>
NativeBrowserControl::NativeBrowserControl(void)
{
parentHWnd = nsnull;
@@ -258,6 +261,44 @@ NativeBrowserControl::Destroy(void)
parentHWnd = nsnull;
}
// handle focus in and focus out events
void
NativeBrowserControl::TopLevelFocusIn(void)
{
if (mIsDestroyed)
return;
nsCOMPtr<nsPIDOMWindow> piWin;
GetPIDOMWindow(getter_AddRefs(piWin));
if (!piWin)
return;
nsCOMPtr<nsIFocusController> focusController;
piWin->GetRootFocusController(getter_AddRefs(focusController));
if (focusController)
focusController->SetActive(PR_TRUE);
}
void
NativeBrowserControl::TopLevelFocusOut(void)
{
if (mIsDestroyed)
return;
nsCOMPtr<nsPIDOMWindow> piWin;
GetPIDOMWindow(getter_AddRefs(piWin));
if (!piWin)
return;
nsCOMPtr<nsIFocusController> focusController;
piWin->GetRootFocusController(getter_AddRefs(focusController));
if (focusController)
focusController->SetActive(PR_FALSE);
}
NativeWrapperFactory *NativeBrowserControl::GetWrapperFactory()
{
return wrapperFactory;