diff --git a/mozilla/widget/src/os2/nsFrameWindow.cpp b/mozilla/widget/src/os2/nsFrameWindow.cpp index 571a060f091..facce124d4e 100644 --- a/mozilla/widget/src/os2/nsFrameWindow.cpp +++ b/mozilla/widget/src/os2/nsFrameWindow.cpp @@ -441,6 +441,12 @@ MRESULT nsFrameWindow::FrameMessage( ULONG msg, MPARAM mp1, MPARAM mp2) } } break; + /* To simulate Windows better, we need to send a focus message to the */ + /* client when the frame is activated */ + case WM_ACTIVATE: + if (SHORT1FROMMP(mp1)) + WinPostMsg(mWnd, WM_FOCUSCHANGED, 0, MPFROM2SHORT(1,0)); + break; } if( !bDone) diff --git a/mozilla/widget/src/os2/nsWindow.cpp b/mozilla/widget/src/os2/nsWindow.cpp index 68dfb0204ce..24734a03a41 100644 --- a/mozilla/widget/src/os2/nsWindow.cpp +++ b/mozilla/widget/src/os2/nsWindow.cpp @@ -2608,7 +2608,9 @@ PRBool nsWindow::ProcessMessage( ULONG msg, MPARAM mp1, MPARAM mp2, MRESULT &rc) printf("[%x] NS_GOTFOCUS (%d)\n", this, mWindowIdentifier); #endif result = DispatchFocus(NS_GOTFOCUS, isMozWindowTakingFocus); - if (gJustGotActivate) { + /* If mp1 is 0, this is the special WM_FOCUSCHANGED we got */ + /* from the frame activate, so act like we just got activated */ + if (gJustGotActivate || mp1 == 0) { gJustGotActivate = PR_FALSE; gJustGotDeactivate = PR_FALSE; #ifdef DEBUG_FOCUS