Certain input method breaks with gtk 4.8
Steps to reproduce
Use GTK_IM_MODULE=fcitx or GTK_IM_MODULE=ibus, with fcitx/ibus-hangul.
This specifically breaks input method that commit string but still having preedit.
See the report on fcitx side. https://github.com/fcitx/fcitx5/issues/600
I can easily reproduce the same issue with ibus-hangul + GTK_IM_MODULE=ibus
For hangul case, here's what's happening:
- Press g -> preedit: ㅎ
- Press k -> preedit is updated to 하
- Press r -> preedit is updated to 학
- Press s -> commit 학, and set preedit to ㄴ.
At this point, gtk initiate a reset to input method and then clear the state, which is wrong. Even after commit string, input method may still expect to preserve its state. Same issue does not happen or gtk < 4.6.
in the previous case, after press "s", reset is not sent to input method.
See the bisect commit id.