From 9ef2c648ee557d25d2598a42fdc7854101709f00 Mon Sep 17 00:00:00 2001 From: Qian Hong Date: Wed, 3 Jul 2013 03:54:41 +0800 Subject: [PATCH] user32: Properly update caret position after result string is committed. --- dlls/user32/edit.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/dlls/user32/edit.c b/dlls/user32/edit.c index 3e5a850297f..3634710866e 100644 --- a/dlls/user32/edit.c +++ b/dlls/user32/edit.c @@ -4421,10 +4421,16 @@ static void EDIT_ImeComposition(HWND hwnd, LPARAM CompFlag, EDITSTATE *es) return; if (CompFlag & GCS_RESULTSTR) + { EDIT_GetResultStr(hIMC, es); - if (CompFlag & GCS_COMPSTR) - EDIT_GetCompositionStr(hIMC, CompFlag, es); - cursor = ImmGetCompositionStringW(hIMC, GCS_CURSORPOS, 0, 0); + cursor = 0; + } + else + { + if (CompFlag & GCS_COMPSTR) + EDIT_GetCompositionStr(hIMC, CompFlag, es); + cursor = ImmGetCompositionStringW(hIMC, GCS_CURSORPOS, 0, 0); + } ImmReleaseContext(hwnd, hIMC); EDIT_SetCaretPos(es, es->selection_start + cursor, es->flags & EF_AFTER_WRAP); }