fcitx5 repeatedly activate/deactivate input method when using firefox on wayland
Package Information
- Package name: fcitx5
- Package version: 5.1.9-r0
- Alpine version: 3.20 (the package is from edge/test, though)
- Alpine architecture: Architecture obtained via
x86_64
Summary
Related issue (#16138 (closed)): I started having trouble with firefox flickering since I updated to alpine linux 3.20. This turns out to be a symptom of fcitx5 misbehaving. It also cause typing in text input fields harder and can lead to random key drops.
I'll repeat the desktop setup here:
- sway: 1.9-r2
- xwayland: 23.2.6
- wayland: 1.22.0
- xorg-server: 21.1.13
It looks like that issue is caused by fcitx5 repeatedly activate and deactivate input method, as is shown in the debug log:
D2024-06-04 17:21:36.342129 instance.cpp:2415] Instance::deactivateInputMethod event_type=4100
D2024-06-04 17:21:36.342210 instance.cpp:2433] Deactivate: [Last]:keyboard-us [Deactivating]:keyboard-us
D2024-06-04 17:21:36.355891 instance.cpp:2373] Instance::activateInputMethod
D2024-06-04 17:21:36.355976 instance.cpp:2378] Activate: [Last]: [Activating]:keyboard-us
My log shows that this happens roughly 30-40 times per second.
Repeatedly pressing "Alt" key while in an input field sometimes stops this problem for a while, but may start again when I click on the URL bar.
Ultimately, fcitx5 got an error with wayland connection and shuts down itself, after which the flickering on firefox also stops:
E2024-06-04 20:41:55.977182 waylandeventreader.cpp:129] Wayland connection got error: 109
Steps to reproduce
- Run
fcitx5 --verbose default=5
. Point stderr to a file if needed - Open firefox
- Click on firefox's URL bar. See it flickers for a while.
- fcitx5 dies. The log contains repeated activate/deactivate
Behavior with other graphical applications
This is also reproducible on badwolf (WebkitGTK browser), but there is no visible flickering. However, it is much harder to type on compared to type on firefox, and I cannot type in other input methods at all.
Text inputs other than URL bar also has this effect, but it is most visible with the URL bar on firefox.
This does not happen on chromium and gimp, but it seems that's because they do not work with fcitx5.
I suspected this was a GTK issue, because I don't have this issue with Qt apps (nheko, keepassxc, krita, qutebrowser) nor my terminal (foot), but inkscape doesn't have this issue either.