On Thu Oct 23 14:20:47 2025 +0000, Marc-Aurel Zent wrote:
Worked fine for me and I couldn't see any reason why it should matter FWIW. By the looks of it `commandDone` seems to be from the original IME implementation and `doCommandBySelector:` (which is also deprecated since macOS 10.6, maybe we should implement this differently) eats up the selector for a key binding command in the `NSTextInput`, and sets `commandDone` to `TRUE`, indicating that this event was not handled by the native IME system and should've been passed up the responder chain. Wow! Honestly, I had the same idea, but I didn't know about OnMainThread. Since it makes ime processing responsiveness so much better, I hope it continues.
When commandDone is set to TRUE in doCommandBySelector:, macdrv_ime_process_key returns FALSE even if NSTextInputContext::handleEvent's return value is TRUE. This is necessary so that the key_assumed value is set correctly in win32u's ime_driver_call and the WM_IME_KEYDOWN message is generated. Modifications are needed for completeText:, setMarkedText:. Currently, after macdrv_ImeProcessKey returns, macdrv_im_set_text is called. IM_SET_TEXT is also unnecessary. When I tested it before, completeText:, setMarkedText: were called before NSTextInputContext::handleEvent returned. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9260#note_119483