From 20386b8ea6e2f059a2deb4eb43dab3ddfd8eaca8 Mon Sep 17 00:00:00 2001 From: "yokoyama%netscape.com" Date: Sat, 29 Sep 2001 00:15:21 +0000 Subject: [PATCH] bug 88425 Force to end IMEComposition when user switches keyboard layout. /r=ftang;/sr=shaver git-svn-id: svn://10.0.0.236/trunk@104175 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/widget/src/windows/nsWindow.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/mozilla/widget/src/windows/nsWindow.cpp b/mozilla/widget/src/windows/nsWindow.cpp index 7e810354a15..a19ef6d8558 100644 --- a/mozilla/widget/src/windows/nsWindow.cpp +++ b/mozilla/widget/src/windows/nsWindow.cpp @@ -4965,15 +4965,20 @@ BOOL nsWindow::OnInputLangChange(HKL aHKL, LRESULT *oRetValue) printf("OnInputLanguageChange\n"); #endif + if(gKeyboardLayout != aHKL) + { + gKeyboardLayout = aHKL; + *oRetValue = LangIDToCP((WORD)((DWORD)gKeyboardLayout & 0x0FFFF), + gCurrentKeyboardCP); + } - if(gKeyboardLayout != aHKL) - { - gKeyboardLayout = aHKL; - *oRetValue = LangIDToCP((WORD)((DWORD)gKeyboardLayout & 0x0FFFF), - gCurrentKeyboardCP); - } - ResetInputState(); - return PR_FALSE; // always pass to child window + ResetInputState(); + + if (mIMEIsComposing) { + HandleEndComposition(); + } + + return PR_FALSE; // always pass to child window } //========================================================================== BOOL nsWindow::OnIMEChar(BYTE aByte1, BYTE aByte2, LPARAM aKeyState)