Sadly this will break some specific sequences (Japanese NIHONGO-NO, or Korean GA-NA-DA) as described in https://gitlab.winehq.org/wine/wine/-/merge_requests/2637 and https://gitlab.winehq.org/wine/wine/-/merge_requests/2749.
The sequences work with a result string committed at the same time as, or shortly before, a new composition string is provided, beginning the next composition. We need to report the result string first, and then the new composition string.
I still think this is a case where XIM sequence is broken, and where we send the IME updates in the wrong order. I updated https://gitlab.winehq.org/wine/wine/-/merge_requests/2698 with a better fix, to fix the event order and avoid reporting the previous composition string when the result string is committed (which was missing before).