On Mon Nov 3 15:45:47 2025 +0000, Byeongsik Jeon wrote:
Based on v3, I'll summarize my opinion. As mentioned above, because QUERY_IME_CHAR_RECT(firstRectForCharacterRange) is trapped in OnMainThread, query_ime_char_rect() is not called, resulting in a 0.6s timeout (two firstRectForCharacterRange call) on the Japanese keyboard. QUERY_EVENT_NO_PREEMPT_WAIT(33610da6) was necessary because macdrv_ime_process_key used OnMainThreadAsync. This prevented some order changes in handling QUERY_IME_CHAR_RECT and IM_SET_TEXT events handling. Since it is no longer needed in this MR, QUERY_IME_CHAR_RECT can be handled as a QUERY_EVENT. Again, to prevent order changes in handling QUERY_EVENT::QUERY_IME_CHAR_RECT and IM_SET_TEXT events, IM_SET_TEXT also needs to be handled in OnMainThread. This allows us to remove NtUserMsgWaitForMultipleObjectsEx.
I am currently working getting rid of all QUERY_EVENT and QUERY_EVENT_NO_PREEMPT_WAIT logic, and also by extension IM_SET_TEXT.
We unfortunately can't just do IM_SET_TEXT on the main thread, due to it not being the wine thread, and IM_SET_TEXT also needs to be handled when the mouse interacts with the native IME UI, so it is not enough to refactor it to be coupled together with macdrv_ime_process_key.