On Mon Nov 3 08:07:50 2025 +0000, Rémi Bernon wrote:
I don't think it's good to call `macdrv_ProcessEvents` directly. Why is it still necessary if the key processing is synchronous?
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.