Gtk 3.24.26's preedit is breaking accented input on popular websites like WhatsApp, when using Firefox
Using Firefox, on certain websites, such as WhatsApp Web, when the first character on an input field (search bar, text etc.) is accented or composed, it gets immediately deleted. This happens repeatedly and effectively this character cannot be typed in that position. A workaround is to e.g. type another random temp character, then the accented character, then remove the temp character; obviously not very practical.
I am Greek, and words starting with an accented letter are extremely common (as is WhatsApp in Greece), so I consider this as a major usability issue.
I encountered this issue after upgrading a desktop from Debian bullseye (Gtk+ 3.24.24) to bookworm (Gtk+ 3.24.37), but after a quick search, it seems multiple other users have reported similar issues in the ArchLinux subreddit, the Firefox subreddit, and the Manjaro forum:
- https://forum.manjaro.org/t/whatsapp-web-deleting-letter-that-starts-with-accent/119772/8
- https://www.reddit.com/r/archlinux/comments/wske77/firefox_deleting_accented_characters/
- https://www.reddit.com/r/firefox/comments/xpx262/cant_use_accents_in_reddit_fancy_editor_or/
- https://www.reddit.com/r/firefox/comments/wq5whz/cant_type_accented_characters_on_some_websites/
The reports mention that beyond WhatsApp, Reddit's "fancy editor" is also broken, but I have not verified this. The advice in all those threads is to set GTK_IM_MODULE=xim
, which works for me as well to workaround this bug.
I've bisected this, and 523d5121 seems to be the culprit for my use case of accented characters. Backing out this commit actually removes this new preedit behavior for accented characters (dead keys) and restores the functionality. Even with this commit backed out though, the same behavior persists when using compose (in which case, ⎄ appears). My suspicion is that the issue has to do with a fake character (either ⎄ before 523d5121, or · for Compose/the underlined accent after) being injected and then later removed.
(As a side rant, while I see the value of this new preedit feature for the Compose key, I find it very distracting for dead keys: in my native Greek, one has to typically one accent in every word, so this is something that is shown quite a bit, so the commit message of this commit above of making things "less intrusive" does not really resonate with me
Steps to reproduce
- Use Gtk+ 3.24.26+ (I used 3.24.27)
- Start up Firefox (I'm using 111)
- Navigate to WhatsApp Web (web.whatsapp.com)
- Try to enter in the search box or in a chat box an accented character, e.g. for the word "έλα". Alternatively, try to use the Compose key with a character.
Note that this issue happens:
- without
GTK_IM_MODULE
being set, but not withGTK_IM_MODULE=xim
. I have not tried ibus. - with Firefox, but not with Chromium
- on certain websites such as WhatsApp Web, but not in the Firefox search bar, or other HTML input fields
- only with the first letter in the input box, not an accented character in the middle of the word
- on X11; I have not tried Wayland
Version information
- Debian bookworm with its shipped Gtk package, Gtk+ 3.24.27
- On my custom builds when I was bisecting, I built with
-Dbroadway_backend=false -Dcolord=no -Dgtk_doc=false -Dintrospection=false -Dman=false -Dwayland_backend=false -Dprint_backends=file -Dx11_backend=true -Dinstalled_tests=false