IIUC `ime_ui_update_window` is always called from the IME UI window procedure, which is created lazily, in `get_ime_ui_window`. I think it's meant to live in the same thread as the activated context window but I don't remember the logic very well here. I'm thinking maybe the IME UI window should rather be destroyed then re-created in the proper thread, if the IME context target window thread changes?