[PATCH 2/2] winex11: Remove the non-appropriate ImmSetOpenStatus() call.

Byeongsik Jeon bsjeon at hanmail.net
Mon Apr 4 08:49:11 CDT 2022


IME_SetResultString() is a function called in a very common situation,
ImmSetOpenStatus() is not appropriate HERE.
In native opensource IME, IMC_SETOPENSTATUS cleans the Composition string
of input context. The winex11.drv IMC_SETOPENSTATUS code is implemented
to produce similar effects. So the common input process is BROKEN.
Perhaps, I guess the original intention is IME_SetCompositionStatus().

This problem occurs in ibus-hangul, and it occurs very frequently.
The ibus-hangul always delivers the XIM_PREEDIT_DONE message
before XIM_COMMIT( ~= GCS_RESULTSTR).

Signed-off-by: Byeongsik Jeon <bsjeon at hanmail.net>
---
 dlls/winex11.drv/ime.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/dlls/winex11.drv/ime.c b/dlls/winex11.drv/ime.c
index c1584930861..5f65281d214 100644
--- a/dlls/winex11.drv/ime.c
+++ b/dlls/winex11.drv/ime.c
@@ -1021,7 +1021,6 @@ void IME_SetResultString(LPWSTR lpResult, DWORD dwResultLen)
     LPINPUTCONTEXT lpIMC;
     HIMCC newCompStr;
     LPIMEPRIVATE myPrivate;
-    BOOL inComp;
 
     imc = RealIMC(FROM_X11);
     lpIMC = ImmLockIMC(imc);
@@ -1037,21 +1036,15 @@ void IME_SetResultString(LPWSTR lpResult, DWORD dwResultLen)
     lpIMC->hCompStr = newCompStr;
 
     myPrivate = ImmLockIMCC(lpIMC->hPrivate);
-    inComp = myPrivate->bInComposition;
-    ImmUnlockIMCC(lpIMC->hPrivate);
-
-    if (!inComp)
-    {
-        ImmSetOpenStatus(imc, TRUE);
+    if (!myPrivate->bInComposition)
         GenerateIMEMessage(imc, WM_IME_STARTCOMPOSITION, 0, 0);
-    }
 
     GenerateIMEMessage(imc, WM_IME_COMPOSITION, 0, GCS_COMPSTR);
     GenerateIMEMessage(imc, WM_IME_COMPOSITION, lpResult[0], GCS_RESULTSTR|GCS_RESULTCLAUSE);
     GenerateIMEMessage(imc, WM_IME_ENDCOMPOSITION, 0, 0);
+    myPrivate->bInComposition = FALSE;
+    ImmUnlockIMCC(lpIMC->hPrivate);
 
-    if (!inComp)
-        ImmSetOpenStatus(imc, FALSE);
 
     ImmUnlockIMC(imc);
 }
-- 
2.35.1




More information about the wine-devel mailing list