On Mon Nov 3 08:13:53 2025 +0000, Marc-Aurel Zent wrote:
With the current design we need to handle `IM_SET_TEXT` (which is generated by the key processing itself) before `macdrv_ImeProcessKey()` returns, otherwise the issue @bsjeon described above happens. Of course this is still not completely race-free (but the previous version also wasn't), since the thread running `- (void) completeText:(NSString*)text` and generating this event can be preempted at any time.
In that case maybe going through a `NtUserMsgWaitForMultipleObjectsEx` call is the best option for now if we cannot get rid of the IM_SET_TEXT event.