From 8934664f7b41fdca0538658fc4e8098c600e24cb Mon Sep 17 00:00:00 2001 From: "rjc%netscape.com" Date: Wed, 20 Feb 2002 05:42:24 +0000 Subject: [PATCH] Fix bug # 125158: force focus on Mac OS X sheets. code from saari, r=bryner sr=hyatt git-svn-id: svn://10.0.0.236/trunk@115049 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/widget/src/mac/nsMacWindow.cpp | 4 ++++ mozilla/xpfe/appshell/src/nsWebShellWindow.cpp | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mozilla/widget/src/mac/nsMacWindow.cpp b/mozilla/widget/src/mac/nsMacWindow.cpp index 02de4418f46..8daefa225b8 100644 --- a/mozilla/widget/src/mac/nsMacWindow.cpp +++ b/mozilla/widget/src/mac/nsMacWindow.cpp @@ -817,6 +817,8 @@ NS_IMETHODIMP nsMacWindow::Show(PRBool bState) WindowPtr top = GetWindowTop(parentWindowRef); ::ShowSheetWindow(mWindowPtr, top); UpdateWindowMenubar(parentWindowRef, PR_FALSE); + gEventDispatchHandler.DispatchGuiEvent(this, NS_GOTFOCUS); + gEventDispatchHandler.DispatchGuiEvent(this, NS_ACTIVATE); } else #endif @@ -848,6 +850,8 @@ NS_IMETHODIMP nsMacWindow::Show(PRBool bState) if (mIsSheet) { ::HideSheetWindow(mWindowPtr); + gEventDispatchHandler.DispatchGuiEvent(this, NS_DEACTIVATE); + // if we had several sheets open, when the last one goes away // we need to ensure that the top app window is active WindowPtr top = GetWindowTop(parentWindowRef); diff --git a/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp b/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp index 9001b845ac0..c07540f74fd 100644 --- a/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp +++ b/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp @@ -491,9 +491,6 @@ nsWebShellWindow::HandleEvent(nsGUIEvent *aEvent) #ifdef DEBUG_saari printf("nsWebShellWindow::NS_ACTIVATE\n"); #endif -// Sucky platform specific code to get around event dispatch ordering -#if defined(WIN32) || defined(XP_OS2) || defined (MOZ_WIDGET_GTK) || defined (MOZ_WIDGET_XLIB) - nsCOMPtr domWindow; eventWindow->ConvertWebShellToDOMWindow(webShell, getter_AddRefs(domWindow)); /* @@ -516,7 +513,6 @@ nsWebShellWindow::HandleEvent(nsGUIEvent *aEvent) if(privateDOMWindow) privateDOMWindow->Activate(); } -#endif /* defined(WIN32) || defined(XP_OS2) || defined (MOZ_WIDGET_GTK) || defined (MOZ_WIDGET_XLIB) */ break; }