#57332 Quick typing erases a converting text

Let all ime/key message have the same priority.
p=shotaro kamio,   r=shanjian, sr=kin


git-svn-id: svn://10.0.0.236/trunk@127213 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
shanjian%netscape.com
2002-08-13 23:43:01 +00:00
parent 7c90640409
commit 3e0bcd1533

View File

@@ -91,6 +91,28 @@ NS_METHOD nsAppShell::SetDispatchListener(nsDispatchListener* aDispatchListener)
#include "nsITimerManager.h"
BOOL PeekKeyAndIMEMessage(LPMSG msg, HWND hwnd)
{
MSG msg1, msg2, *lpMsg;
BOOL b1, b2;
b1 = ::PeekMessage(&msg1, NULL, WM_KEYFIRST, WM_IME_KEYLAST, PM_NOREMOVE);
b2 = ::PeekMessage(&msg2, NULL, WM_IME_SETCONTEXT, WM_IME_KEYUP, PM_NOREMOVE);
if (b1 || b2) {
if (b1 && b2) {
if (msg1.time < msg2.time)
lpMsg = &msg1;
else
lpMsg = &msg2;
} else if (b1)
lpMsg = &msg1;
else
lpMsg = &msg2;
return ::PeekMessage(msg, hwnd, lpMsg->message, lpMsg->message, PM_REMOVE);
}
return false;
}
NS_METHOD nsAppShell::Run(void)
{
@@ -109,7 +131,7 @@ NS_METHOD nsAppShell::Run(void)
do {
// Give priority to system messages (in particular keyboard, mouse,
// timer, and paint messages).
if (::PeekMessage(&msg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE) ||
if (PeekKeyAndIMEMessage(&msg, NULL) ||
::PeekMessage(&msg, NULL, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE) ||
::PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {