Preedit contains old values after switching input method mid-composition
Steps to reproduce
- Use
ibus
(any version at the time of this issue works, presently 1.5.30) - Use X11 (required, Wayland doesn't exhibit this bug)
- Use GTK4 (didn't test with GTK3)
- Hook up all the preedit events and commit events for a multi-IM
- Enable a keyboard layout with dead keys (US intl, Spanish, etc.). For the steps I'll assume Spanish.
- Type
'
, preedit start and change is triggered and we enter a composition state - Press backspace, preedit change and end is triggered and we exit a composition state
- Press
ctrl+shift+u
to enter Unicode input mode - preedit start and changed are triggered
-
gtk_im_context_get_preedit_string
reportsu'
Current behavior
gtk_im_context_get_preedit_string
reports u'
Expected outcome
gtk_im_context_get_preedit_string
should report u
(no apostrophe which was part of the previous, ended composition)
This may be an ibus issue as well, I didn't do the diligence on those layers to determine that, but as a GTK app developer I don't see a mechanism to workaround the issue regardless since GTK is reporting this preedit string.
Version information
- GTK 4.16.3
- Ubuntu 24.04 LTS
- X11 (required, Wayland does NOT exhibit this issue)
- ibus (required, this does NOT exhibit with fcitx)
Edited by Mitchell Hashimoto