Bug 962140 NativeKey should not check scan code at comparing found char message and removed char message r=jimm
authorMasayuki Nakano <masayuki@d-toybox.com>
Tue, 18 Feb 2014 21:42:04 +0900
changeset 169335 efd7039a2ff2372e733e2e5981e932ff27971627
parent 169276 148794d81e95d621050a7b442000e3e678d2cc1d
child 169336 9254485c7f9d1c7da7e8641466fcfe966345095b
push id26245
push userryanvm@gmail.com
push dateTue, 18 Feb 2014 20:18:17 +0000
treeherdermozilla-central@9019cc90719c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm
bugs962140
milestone30.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 962140 NativeKey should not check scan code at comparing found char message and removed char message r=jimm
widget/windows/KeyboardLayout.cpp
--- a/widget/windows/KeyboardLayout.cpp
+++ b/widget/windows/KeyboardLayout.cpp
@@ -1362,19 +1362,24 @@ NativeKey::GetFollowingCharMessage(MSG& 
       MOZ_CRASH("We lost the following char message");
     }
 
     // Retry for the strange case.
     if (removedMsg.message == WM_NULL) {
       continue;
     }
 
+    // NOTE: Although, we don't know when this case occurs, the scan code value
+    //       in lParam may be changed from 0 to something.  The changed value
+    //       is different from the scan code of handling keydown message.
+    static const LPARAM kScanCodeMask = 0x00FF0000;
     if (removedMsg.message != nextKeyMsg.message ||
         removedMsg.wParam != nextKeyMsg.wParam ||
-        removedMsg.lParam != nextKeyMsg.lParam) {
+        (removedMsg.lParam & ~kScanCodeMask) !=
+          (nextKeyMsg.lParam & ~kScanCodeMask)) {
 #ifdef MOZ_CRASHREPORTER
       nsPrintfCString info("\nHandling message: %s (0x%08X), wParam: 0x%08X, "
                            "lParam: 0x%08X, InSendMessageEx()=%s, \n"
                            "Found message: %s (0x%08X), wParam: 0x%08X, "
                            "lParam: 0x%08X, \nRemoved message: %s (0x%08X), "
                            "wParam: 0x%08X, lParam: 0x%08X",
                            GetMessageName(mMsg.message),
                            mMsg.message, mMsg.wParam, mMsg.lParam,