On Mon Nov 3 13:17:23 2025 +0000, Marc-Aurel Zent wrote:
Getting rid of IM_SET_TEXT is a bit more involved I believe, so for now it is probably best to keep `NtUserMsgWaitForMultipleObjectsEx`.
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.