part of previous checkin

git-svn-id: svn://10.0.0.236/trunk@58830 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
saari%netscape.com
2000-01-26 22:48:16 +00:00
parent 53bba58131
commit 6899f63cca
3 changed files with 160 additions and 1 deletions

View File

@@ -41,6 +41,7 @@ static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#include "nsVoidArray.h"
#include "nsIScriptGlobalObject.h"
#include "nsIDOMWindow.h"
#include "nsPIDOMWindow.h"
#include "nsIDOMEventTarget.h"
#include "nsIDOMFocusListener.h"
@@ -504,7 +505,32 @@ nsWebShellWindow::HandleEvent(nsGUIEvent *aEvent)
}
case NS_MOUSE_ACTIVATE:
case NS_ACTIVATE:
case NS_ACTIVATE: {
void* data;
aEvent->widget->GetClientData(data);
if (data) {
nsCOMPtr<nsIDOMWindow> domWindow;
nsCOMPtr<nsIWebShell> contentShell;
((nsWebShellWindow *)data)->GetContentWebShell(getter_AddRefs(contentShell));
if (contentShell) {
if (NS_SUCCEEDED(((nsWebShellWindow *)data)->
ConvertWebShellToDOMWindow(contentShell, getter_AddRefs(domWindow)))) {
nsCOMPtr<nsPIDOMWindow> privateDOMWindow = do_QueryInterface(domWindow);
if(privateDOMWindow)
privateDOMWindow->Activate();
}
}
else if (webShell && NS_SUCCEEDED(((nsWebShellWindow *)data)->
ConvertWebShellToDOMWindow(webShell, getter_AddRefs(domWindow)))) {
nsCOMPtr<nsPIDOMWindow> privateDOMWindow = do_QueryInterface(domWindow);
if(privateDOMWindow)
privateDOMWindow->Activate();
}
}
break;
}
case NS_GOTFOCUS: {
void* data;
aEvent->widget->GetClientData(data);
@@ -524,7 +550,35 @@ nsWebShellWindow::HandleEvent(nsGUIEvent *aEvent)
domWindow->Focus();
}
}
break;
}
case NS_DEACTIVATE: {
void* data;
aEvent->widget->GetClientData(data);
if (data) {
nsCOMPtr<nsIDOMWindow> domWindow;
nsCOMPtr<nsIWebShell> contentShell;
((nsWebShellWindow *)data)->GetContentWebShell(getter_AddRefs(contentShell));
if (contentShell) {
if (NS_SUCCEEDED(((nsWebShellWindow *)data)->
ConvertWebShellToDOMWindow(contentShell, getter_AddRefs(domWindow)))) {
nsCOMPtr<nsPIDOMWindow> privateDOMWindow = do_QueryInterface(domWindow);
if(privateDOMWindow)
privateDOMWindow->Deactivate();
}
}
else if (webShell && NS_SUCCEEDED(((nsWebShellWindow *)data)->
ConvertWebShellToDOMWindow(webShell, getter_AddRefs(domWindow)))) {
nsCOMPtr<nsPIDOMWindow> privateDOMWindow = do_QueryInterface(domWindow);
if(privateDOMWindow)
privateDOMWindow->Deactivate();
}
}
break;
}
default:
break;