Bug 981963 Ignore following char message if its wParam is 0 r=jimm, a=sledru
authorMasayuki Nakano <masayuki@d-toybox.com>
Mon, 24 Mar 2014 23:32:30 +0900
changeset 192242 dce0c66c663697e8aa3e97613c6396633a18fc43
parent 192241 3ceb8ccba04cd1d9e98872e17270199dceb1a2e3
child 192243 a5bb91ab9c00b415d51a0a22fcc865b3a4705810
push id474
push userasasaki@mozilla.com
push dateMon, 02 Jun 2014 21:01:02 +0000
treeherdermozilla-release@967f4cf1b31c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm, sledru
bugs981963
milestone30.0a2
Bug 981963 Ignore following char message if its wParam is 0 r=jimm, a=sledru
widget/windows/KeyboardLayout.cpp
--- a/widget/windows/KeyboardLayout.cpp
+++ b/widget/windows/KeyboardLayout.cpp
@@ -1442,16 +1442,23 @@ NativeKey::GetFollowingCharMessage(MSG& 
       MOZ_CRASH("We lost the following char message");
     }
 
     // Retry for the strange case.
     if (removedMsg.message == WM_NULL) {
       continue;
     }
 
+    // Typically, this case occurs with WM_DEADCHAR.  If the removed message's
+    // wParam becomes 0, that means that the key event shouldn't cause text
+    // input.  So, let's ignore the strange char message.
+    if (removedMsg.message == nextKeyMsg.message && !removedMsg.wParam) {
+      return false;
+    }
+
     // 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.
     if (!MayBeSameCharMessage(removedMsg, nextKeyMsg)) {
 #ifdef MOZ_CRASHREPORTER
       nsPrintfCString info("\nPeekMessage() removed unexpcted char message! "
                            "\nHandling message: %s (0x%08X), wParam: 0x%08X, "
                            "lParam: 0x%08X, hwnd=0x%p, InSendMessageEx()=%s, "