Piotr Caban : imm32: Exit early in ImmTranslateMessage when there was no new input.

Alexandre Julliard julliard at winehq.org
Mon Sep 28 14:49:26 CDT 2020


Module: wine
Branch: master
Commit: c9988c885d22a911301cf4df681d9d033ecfb5fe
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=c9988c885d22a911301cf4df681d9d033ecfb5fe

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Fri Sep 25 18:44:56 2020 +0200

imm32: Exit early in ImmTranslateMessage when there was no new input.

Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/imm32/imm.c         | 2 +-
 dlls/imm32/tests/imm32.c | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/dlls/imm32/imm.c b/dlls/imm32/imm.c
index 5f68c1d27d..0f3d7d5f8c 100644
--- a/dlls/imm32/imm.c
+++ b/dlls/imm32/imm.c
@@ -3045,7 +3045,7 @@ BOOL WINAPI ImmTranslateMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lKeyD
     else
         return FALSE;
 
-    if (!data->immKbd->hIME || !data->immKbd->pImeToAsciiEx)
+    if (!data->immKbd->hIME || !data->immKbd->pImeToAsciiEx || data->lastVK == VK_PROCESSKEY)
         return FALSE;
 
     GetKeyboardState(state);
diff --git a/dlls/imm32/tests/imm32.c b/dlls/imm32/tests/imm32.c
index 040a43fc05..827b31eec2 100644
--- a/dlls/imm32/tests/imm32.c
+++ b/dlls/imm32/tests/imm32.c
@@ -1643,6 +1643,8 @@ static void test_ime_processkey(void)
                 trace("ProcessKey was correctly found\n");
         }
         TranslateMessage(&msg);
+        /* test calling TranslateMessage multiple times */
+        TranslateMessage(&msg);
         DispatchMessageW(&msg);
     }
 




More information about the wine-cvs mailing list