https://bugs.winehq.org/show_bug.cgi?id=54318
Bug ID: 54318 Summary: Rich Edit inserts newly composed text at wrong position when system IME composition ends while a selection is active Product: Wine Version: 8.0-rc4 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: richedit Assignee: wine-bugs@winehq.org Reporter: jinoh.kang.kr@gmail.com CC: huw@codeweavers.com Distribution: ---
When the user attempts to perform select-and-replace with newly composed text from system IME (fcitx5) as the replacement, Rich Edit inserts the new text at the _ending_ character position of the current selection, instead of the _starting_ character position.
Steps to reproduce:
1. Activate fcitx5 (Hangul). 2. Enter the following text: "[ABCXYZ]" 3. Select the following text: "ABC" 4. Compose a character.
Expected behaviour:
The composed character should replace "ABC".
Actual behaviour:
The text "ABC" is erased, but the newly composed character is inserted after "Z", before "]".
https://bugs.winehq.org/show_bug.cgi?id=54318
--- Comment #1 from Jinoh Kang jinoh.kang.kr@gmail.com --- Steps to reproduce (expanded):
1. Activate fcitx5 (Hangul). 2. Open write.exe, or any other application with a Rich Edit control. 3. Give focus to the Rich Edit control. 4. Enter the following text: "[ABCXYZ]" 5. Select the following text from beginning to end: "ABC" 6. Compose a character.
Note that selecting the text in the reverse order does not appear to exhibit the symptom.
https://bugs.winehq.org/show_bug.cgi?id=54318
Jinoh Kang jinoh.kang.kr@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |aric@codeweavers.com
--- Comment #2 from Jinoh Kang jinoh.kang.kr@gmail.com --- Diagnosis:
In RichEdit WM_IME_STARTCOMPOSITION handler, the composition start position (imeStartIndex) is computed _before_ ME_DeleteSelection() is called. ME_DeleteSelection() shifts the character positions after the range of deletion. This makes imeStartIndex stale, since it does not take into account the number of deleted characters before it.
https://bugs.winehq.org/show_bug.cgi?id=54318
Jinoh Kang jinoh.kang.kr@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |source
https://bugs.winehq.org/show_bug.cgi?id=54318
Jinoh Kang jinoh.kang.kr@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |8c43577f0f9b4422d3641457c59 | |5c3998bd54a18 Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED
--- Comment #3 from Jinoh Kang jinoh.kang.kr@gmail.com --- Fixed in 8c43577f0f9b4422d3641457c595c3998bd54a18. Sorry for the late update.
https://bugs.winehq.org/show_bug.cgi?id=54318
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #4 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 8.2.
https://bugs.winehq.org/show_bug.cgi?id=54318
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |8.0.x
https://bugs.winehq.org/show_bug.cgi?id=54318
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|8.0.x |---
--- Comment #5 from Michael Stefaniuc mstefani@winehq.org --- Removing the 8.0.x milestone from bug fixes included in 8.0.1.