From 2ba9f517a6833c3979b066ec77916fa8b1119ec7 Mon Sep 17 00:00:00 2001 From: "mkaply%us.ibm.com" Date: Wed, 17 Dec 2003 21:02:26 +0000 Subject: [PATCH] #224929 r=pedemont, sr=blizzard (platform specific), a=mkaply Send an extra focus changed message to be more like Windows (Java focus) git-svn-id: svn://10.0.0.236/trunk@150399 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/widget/src/os2/nsFrameWindow.cpp | 6 ++++++ mozilla/widget/src/os2/nsWindow.cpp | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) 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