fix for bug 66742; r=joki, sr=sfraser; grab focusedWidget between keydown and keypress in case it was changed

This commit is contained in:
brade%netscape.com 2001-05-03 20:19:43 +00:00
Родитель ecf9d7b9c2
Коммит d435441ef9
1 изменённых файлов: 10 добавлений и 0 удалений

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

@ -1055,6 +1055,16 @@ PRBool nsMacEventHandler::HandleKeyEvent(EventRecord& aOSEvent)
case keyDown:
InitializeKeyEvent(keyEvent,aOSEvent,focusedWidget,NS_KEY_DOWN);
result = focusedWidget->DispatchWindowEvent(keyEvent);
// get the focused widget again in case something happened to it on the previous event
nsWindow* checkFocusedWidget = gEventDispatchHandler.GetActive();
if (!checkFocusedWidget)
checkFocusedWidget = mTopLevelWidget;
// if this isn't the same widget we had before, we should not send a keypress
if (checkFocusedWidget != focusedWidget)
return result;
//if (result == PR_FALSE) // continue processing??? talk to Tague about this (key event spec)
{
InitializeKeyEvent(keyEvent,aOSEvent,focusedWidget,NS_KEY_PRESS);