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
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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<nsIDOMWindowInternal> 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;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user