I presented the snap problem for James Henstridge, and he gave me a very useful hint: The Chromium snap makes use of the bionic library stack (the gnome-3-28-1804 snap) including the im module installed by fcitx-frontend-gtk3, i.e. the fcitx 4 gtk im module.
That made me think of <https://bugs.debian.org/977203>. That bug is still open, and as a result im-config currently sets these variables for fcitx 5:
I presented the snap problem for James Henstridge, and he gave me a very useful hint: The Chromium snap makes use of the bionic library stack (the gnome-3-28-1804 snap) including the im module installed by fcitx-frontend- gtk3, i.e. the fcitx 4 gtk im module.
That made me think of <https:/ /bugs.debian. org/977203>. That bug is still open, and as a result im-config currently sets these variables for fcitx 5:
GTK_IM_ MODULE= fcitx5 @im=fcitx
XMODIFIERS=
QT_IM_MODULE=fcitx5
It means that it explicitly looks for the fcitx 5 gtk im module, while Chromium only has access to the fcitx 4 one.
So as a test I tweaked im-config to set:
GTK_IM_MODULE=fcitx @im=fcitx
XMODIFIERS=
QT_IM_MODULE=fcitx
and that made a difference. With that environment I could successfully input beautiful Chinese characters in Chromium using fcitx 5. :)
Consequently there seems to be no need to add any extra stuff to apparmor to handle fcitx 5. Instead I see two options:
1. Change im-config's variable assignment, or
2. somehow add the fcitx 5 im modules for gtk and qt to the snap library stack.
I'm going to consult with Debian's input method team about which route is preferable.
@James: Do you see a problem from your POV with adding the fcitx 5 im modules to the snaps?