<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hi<br>
    </p>
    <p>I resubmitted the problems related to this by dividing them into
      4 patches.</p>
    <p>All CJK have tested it on their own, but in my imagination, the
      problem seems to have been solved.</p>
    <p>I tried to create a test, but ImSetCompositionStringW seems to be
      set regardless of dwIndex, so I can't implement it well.</p>
    <p>I'll have to take a look when I have time.</p>
    <br>
    <p><br>
    </p>
    <pre style="color: rgb(0, 0, 0); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; overflow-wrap: break-word; white-space: pre-wrap;">[PATCH v2] winex11.drv: call XIMReset on CPS_COMPLETE</pre>
    <p><a class="moz-txt-link-freetext" href="https://source.winehq.org/patches/data/231256">https://source.winehq.org/patches/data/231256</a></p>
    <p><br>
    </p>
    <pre style="color: rgb(0, 0, 0); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; overflow-wrap: break-word; white-space: pre-wrap;">[PATCH v2] riched20: Send CPS_COMPLETE from mouse click event.</pre>
    <p><a class="moz-txt-link-freetext" href="https://source.winehq.org/patches/data/231251">https://source.winehq.org/patches/data/231251</a></p>
    <p><br>
    </p>
    <pre style="color: rgb(0, 0, 0); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; overflow-wrap: break-word; white-space: pre-wrap;">[PATCH v2] winex11.drv: Call ImeSetCompositionString after IME_SetResultString</pre>
    <p><a class="moz-txt-link-freetext" href="https://source.winehq.org/patches/data/231236">https://source.winehq.org/patches/data/231236</a></p>
    <p><br>
    </p>
    <pre style="color: rgb(0, 0, 0); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; overflow-wrap: break-word; white-space: pre-wrap;">[PATCH v2] riched20: Handle GCS_COMPSTR, GCS_CURSORPOS on WM_IME_COMPOSITION.</pre>
    <p><a class="moz-txt-link-freetext" href="https://source.winehq.org/patches/data/231055">https://source.winehq.org/patches/data/231055</a><br>
    </p>
    <br>
    <p>Regards,</p>
    <p>Alex Kwak<br>
    </p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">22. 3. 26. 19:44에 Akihiro Sagawa 이(가) 쓴
      글:<br>
    </div>
    <blockquote type="cite"
      cite="mid:20220326194434.3894.375B48EC@gmail.com">
      <pre class="moz-quote-pre" wrap="">On Sun, 20 Mar 2022 21:17:27 +0900, Alex Kwak wrote:
</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">In a special case for Hangul(Korean), when Composition is completed and
this function is called, the new Composition disappears. so, calling
IME_SetCompositionString again for makes composition will be
starting.

</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">Please add Wine-Bug header before Signed-off-by line.
</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">Signed-off-by: Alex Kwak <a class="moz-txt-link-rfc2396E" href="mailto:take-me-home@kakao.com"><take-me-home@kakao.com></a>
---
 dlls/winex11.drv/ime.c    |  4 ++--
 dlls/winex11.drv/x11drv.h | 27 +++++++++++++++++++++++++++
 dlls/winex11.drv/xim.c    | 13 +++++++++++++
 3 files changed, 42 insertions(+), 2 deletions(-)

diff --git a/dlls/winex11.drv/ime.c b/dlls/winex11.drv/ime.c
index c1584930861..f7827b31635 100644
--- a/dlls/winex11.drv/ime.c
+++ b/dlls/winex11.drv/ime.c
@@ -1050,8 +1050,8 @@ void IME_SetResultString(LPWSTR lpResult, DWORD dwResultLen)
     GenerateIMEMessage(imc, WM_IME_COMPOSITION, lpResult[0], GCS_RESULTSTR|GCS_RESULTCLAUSE);
     GenerateIMEMessage(imc, WM_IME_ENDCOMPOSITION, 0, 0);
 
-    if (!inComp)
-        ImmSetOpenStatus(imc, FALSE);
+    myPrivate->bInComposition = FALSE;
+    ImmSetOpenStatus(imc, FALSE);
 
     ImmUnlockIMC(imc);
 }
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">I'm not sure about this change.
It always turns off IME open status. Since composition might be
continuous at this moment, it can't be set unconditionally.
If we should do so for some reasons, could you explain in detail?

</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
index f389f3e0836..8ce3a7e8528 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">[..]
</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">--- a/dlls/winex11.drv/xim.c
+++ b/dlls/winex11.drv/xim.c
@@ -117,6 +117,19 @@ void X11DRV_XIMLookupChars( const char *str, DWORD count )
 
     IME_SetResultString(wcOutput, dwOutput);
     HeapFree(GetProcessHeap(), 0, wcOutput);
+
+    /*
+     * In a special case for Hangul(Korean), when Composition is completed and
+     * this function is called, the new Composition disappears. so, calling
+     * IME_SetCompositionString again for makes composition will be
+     * starting.
+     */
+    if (CompositionString && dwCompStringLength >= sizeof(WCHAR) &&
+        IsHangul(((const WCHAR*) CompositionString)[0]))
+    {
+        IME_SetCompositionString(SCS_SETSTR, CompositionString,
+                                 dwCompStringLength, NULL, 0);
+    }
 }
 
 static BOOL XIMPreEditStateNotifyCallback(XIC xic, XPointer p, XPointer data)
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">Could you revert Hangul(Korean) specific changes? This issue seems not
to be Korean specific because I can occasionally reproduce it with
Japanese input method.

>From my point of view, the main cause of this issue is that the order of
PreeditCallbacks and XmbLookupString() aren't stable. The current wine's
implementation seems to rely on getting the result of XmbLookupString()
before PreeditCallback for the next clause. However, when one or more
clauses are left after commiting a clause, PreeditCallback for the left
clauses sometimes (or always in Hangul?) called before getting the
result of XmbLookupString.
What do you think about these XIM situations? Does your patch works
well for both cases?

Regards,
Akihiro Sagawa
</pre>
    </blockquote>
  </body>
</html>