mirror of
https://github.com/storytold/winit.git
synced 2026-11-30 02:08:57 +01:00
Setting the IME spot is a synchronous XIM request, and it went out after the next X event, often one carrying an input method's reply to a key. Xlib handles the keys an input method forwards back while it waits for the request's reply: it puts them back on the event queue in reverse order and marks only the last one as forwarded, so the others are filtered again. The input method gets its own keys back as new key presses, and the app gets them after the text committed with them. Vietnamese engines in fcitx5 that fix a word by forwarding BackSpaces and committing the new tail garble the text this way (rust-windowing/winit#4777, storytold/wordcraft#2932). Input methods only send keys back in answer to keys the client gave them. The latest spot for each window is now queued and sent once no X event is queued and no event has gone to the input method for 100 ms; the event loop wakes up to send it.