So I understand that this still doesn't look right but I'm not sure exactly how?
Would it be a better approach to send this IME input through __wine_send_input and hardware messages, through some kind of HID-like interface? I think it might be more future-proof, and maybe something we want to do ultimately, but it makes some callbacks like winemac cursor rect query more difficult.