On Fri Apr 14 07:31:40 2023 +0000, Byeongsik Jeon wrote:
Kind of, composition string updates are indeed preceded by
WM_IME_STARTCOMPOSITION but only if the composition status indicates that we were not composing already. I think that wasn't done before and I added it as I think WM_IME_COMPOSITION messages are only supposed to be sent between WM_IME_STARTCOMPOSITION and WM_IME_ENDCOMPOSITION. I think this code will satisfy the condition. I don't insist on moving the code to xim_set_result_string().
if (!old_status) ime_set_composition_status( himc, hwnd, TRUE ); ime_send_message( himc, WM_IME_COMPOSITION, len ? str[0] : 0, flags ); if (!old_status) ime_set_composition_status( himc, hwnd, FALSE );
WM_IME_STARTCOMPOSITION > WM_IME_COMPOSITION(GCS_COMPSTR) (* n) >
WM_IME_COMPOSITION(GCS_RESULTSTR) > WM_IME_ENDCOMPOSITION, is this wrong in any way? For Chinese and common Japanese input, this is the correct order. Korean and "some Japanese input style" may have a slightly different order. The point is that there are situations where a result_string is immediately followed by a preedit_string. callback example:
preedit_start preedit_draw x n result_string preedit_draw
In old code(x11drv_ime_set_result):
WM_IME_STARTCOMPOSITION WM_IME_COMPOSITION(GCS_COMPSTR) x n WM_IME_COMPOSITION(GCS_RESULTSTR) WM_IME_ENDCOMPOSITION WM_IME_COMPOSITION(GCS_COMPSTR)
This is a bad situation. In this MR:
WM_IME_STARTCOMPOSITION WM_IME_STARTCOMPOSITION WM_IME_COMPOSITION(GCS_COMPSTR) WM_IME_STARTCOMPOSITION AND WM_IME_COMPOSITION(GCS_COMPSTR) x n-1 WM_IME_COMPOSITION(GCS_RESULTSTR) WM_IME_ENDCOMPOSITION WM_IME_STARTCOMPOSITION WM_IME_COMPOSITION(GCS_COMPSTR)
This is not bad because the last preedit_string is inside the composition_status. But it would be better if it came like this:
WM_IME_STARTCOMPOSITION WM_IME_COMPOSITION(GCS_COMPSTR) x n WM_IME_COMPOSITION(GCS_RESULTSTR) WM_IME_COMPOSITION(GCS_COMPSTR)
I see, I'll try to keep that in mind.
If you have an example of how to reproduce this kind of sequence using Linux IME I'd be very grateful. I don't read any CJK language and I'm mostly just playing around with various IBus engines and checking that it produces some result that look sensible, so if you know which IBus engine I can use, and maybe a simple combination of key that trigger this?