From e685428a2c22fe26210b73d568e04535e3b4698e Mon Sep 17 00:00:00 2001 From: "bryner%netscape.com" Date: Tue, 11 Dec 2001 05:34:32 +0000 Subject: [PATCH] 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 --- mozilla/widget/src/gtk/nsWindow.cpp | 16 +++++++++++----- mozilla/xpfe/appshell/src/nsWebShellWindow.cpp | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/mozilla/widget/src/gtk/nsWindow.cpp b/mozilla/widget/src/gtk/nsWindow.cpp index e421f48a373..959bdd2ea39 100644 --- a/mozilla/widget/src/gtk/nsWindow.cpp +++ b/mozilla/widget/src/gtk/nsWindow.cpp @@ -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(); } diff --git a/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp b/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp index c5dad7c5d6e..afe8084d7d8 100644 --- a/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp +++ b/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp @@ -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 domWindow; eventWindow->ConvertWebShellToDOMWindow(webShell, getter_AddRefs(domWindow));