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.
This commit is contained in:
edburns%acm.org 2004-11-07 15:29:10 +00:00
Родитель cd3153de2e
Коммит f57814cadd
3 изменённых файлов: 45 добавлений и 0 удалений

Просмотреть файл

@ -135,6 +135,8 @@ EmbedProgress::OnStateChange(nsIWebProgress *aWebProgress,
// if we've got the start flag, emit the signal
if ((aStateFlags & STATE_IS_NETWORK) &&
(aStateFlags & STATE_START)) {
mOwner->TopLevelFocusIn();
PR_LOG(prLogModuleInfo, PR_LOG_DEBUG,
("EmbedProgress::OnStateChange: START_DOCUMENT_LOAD\n"));

Просмотреть файл

@ -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;

Просмотреть файл

@ -75,6 +75,8 @@ public:
void Resize (PRUint32 x, PRUint32 y,
PRUint32 aWidth, PRUint32 aHeight);
void Destroy (void);
void TopLevelFocusIn (void);
void TopLevelFocusOut(void);
NativeWrapperFactory * GetWrapperFactory();