Fixing loss of focus when opening a URL in a new tab. If we receive a focus event and have not done an initial reflow yet, go ahead and do one so that we can dispatch the event. Otherwise, the focus controller becomes out of sync with the actual native widget focus. Bug 138237, r=dbaron, sr=waterson, a=asa.

This commit is contained in:
bryner%netscape.com 2002-06-07 00:53:44 +00:00
Родитель d7e4f3d8eb
Коммит 9b37497cfa
2 изменённых файлов: 26 добавлений и 0 удалений

Просмотреть файл

@ -5951,6 +5951,19 @@ PresShell::HandleEvent(nsIView *aView,
return NS_OK;
}
// We really don't want to just drop a focus event on the floor here,
// because the widget-level focus change will have already happened
// by the time we get the event. Rather than dropping it, force an
// initial reflow if we haven't done one yet, so that we can process
// the event.
if (aEvent->message == NS_GOTFOCUS && !mDidInitialReflow && mViewManager) {
nscoord width, height;
mViewManager->GetWindowDimensions(&width, &height);
InitialReflow(width, height);
}
aView->GetClientData(clientData);
frame = (nsIFrame *)clientData;

Просмотреть файл

@ -5951,6 +5951,19 @@ PresShell::HandleEvent(nsIView *aView,
return NS_OK;
}
// We really don't want to just drop a focus event on the floor here,
// because the widget-level focus change will have already happened
// by the time we get the event. Rather than dropping it, force an
// initial reflow if we haven't done one yet, so that we can process
// the event.
if (aEvent->message == NS_GOTFOCUS && !mDidInitialReflow && mViewManager) {
nscoord width, height;
mViewManager->GetWindowDimensions(&width, &height);
InitialReflow(width, height);
}
aView->GetClientData(clientData);
frame = (nsIFrame *)clientData;