From c9988c885d22a911301cf4df681d9d033ecfb5fe Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Fri, 25 Sep 2020 18:44:56 +0200 Subject: [PATCH] imm32: Exit early in ImmTranslateMessage when there was no new input. Signed-off-by: Piotr Caban Signed-off-by: Alexandre Julliard --- 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 5f68c1d27dd..0f3d7d5f8c8 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 040a43fc058..827b31eec2e 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); }