Bug 108787 -- unable to type in Open Web Location dialog when it first appears. r=saari, sr=blizzard.

git-svn-id: svn://10.0.0.236/trunk@110228 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bryner%netscape.com
2001-12-11 05:34:32 +00:00
parent b9740f38fe
commit e685428a2c
2 changed files with 12 additions and 6 deletions

View File

@@ -1211,8 +1211,6 @@ GdkCursor *nsWindow::GtkCreateCursor(nsCursor aCursorType)
NS_IMETHODIMP
nsWindow::SetFocus(PRBool aRaise)
{
PRBool sendActivate = gJustGotActivate;
gJustGotActivate = PR_FALSE;
#ifdef DEBUG_FOCUS
printf("nsWindow::SetFocus %p\n", NS_STATIC_CAST(void *, this));
#endif /* DEBUG_FOCUS */
@@ -1285,9 +1283,6 @@ nsWindow::SetFocus(PRBool aRaise)
#endif // USE_XIM
DispatchSetFocusEvent();
if (sendActivate) {
DispatchActivateEvent();
}
#ifdef DEBUG_FOCUS
printf("Returning:\n");
@@ -1330,6 +1325,12 @@ void nsWindow::DispatchSetFocusEvent(void)
NS_ADDREF_THIS();
DispatchFocus(event);
if (gJustGotActivate) {
gJustGotActivate = PR_FALSE;
DispatchActivateEvent();
}
NS_RELEASE_THIS();
}
@@ -1436,6 +1437,11 @@ void nsWindow::HandleMozAreaFocusIn(void)
// window. embedding handles activate semantics for us.
if (mIsToplevel)
gJustGotActivate = PR_TRUE;
#ifdef USE_XIM
IMESetFocusWindow();
#endif // USE_XIM
DispatchSetFocusEvent();
}

View File

@@ -489,7 +489,7 @@ nsWebShellWindow::HandleEvent(nsGUIEvent *aEvent)
printf("nsWebShellWindow::NS_ACTIVATE\n");
#endif
// Sucky platform specific code to get around event dispatch ordering
#if defined(WIN32) || defined(XP_OS2)
#if defined(WIN32) || defined(XP_OS2) || defined (MOZ_WIDGET_GTK)
nsCOMPtr<nsIDOMWindowInternal> domWindow;
eventWindow->ConvertWebShellToDOMWindow(webShell, getter_AddRefs(domWindow));