winewayland: Ignore text-input "done" events that don't modify state.
Compositors send a "done" event after every text-input commit, even if the reported state (preedit etc) hasn't changed. Acting on such events is at best wasteful, but can additionally lead to incorrect IME related effects (e.g., deleting the currently selected text), so ignore them, similarly to what Qt and GTK do.
The first commit performs some state related cleanups.
--
This solves an IME problem I have been experiencing with compositors that support text-input-v3 (e.g., kwin).
- Run notepad
- Write some text
- Try to select text
Expected result: text is selected
Actual result: text is deleted
What happens is that while the user is selecting text the driver gets a series of SetIMECompositionRect
callback which cause a series of text-input-v3 set_cursor_rectangle
-commit
requests. These commit
s elicit done
events from the compositor with no state changes, which we interpret as "clear the composition string" (and by extension the active selection), because that's what such states normally means, and forward them to windows IME.