This topic discusses the compatibility of a graphical user interface snaps with the input method frameworks broadly used by the Chinese, Japanese, Korean and Vietnamese etc.(CJKV) users. If your snap has a graphical interface and is expected to receive text input from these users, you should check it out.
TL; DR
User-oriented
- Currently support for IBus and Fcitx input method frameworks are implemented in snapd and the
desktop-*
parts. - The support of the input method framework must be done by the packager, if a certain snap isn’t compatible with the supported input methods contact the snap maintainer to do an update or package rebuild.
Packager-oriented
To make the snap compatible with the input method frameworks, you must:
- Connect the snap to the
desktop-legacy
interface - Incorporate one of the desktop helpers remote part and launch the app using the
desktop-launch
launcher
Preface
Unlike most European text input which only requires the keys on the keyboard, CJKV text input requires composing a character via a series of US layout keyboard keystrokes, for example, in order to input “中文” string using the phonetic, or zhu-yin(注音) input method with a 大千style layout keyboard one must type in 5
, j
, /
, and <space>
sequentially to compose “中”(and every Chinese character that has the same pronunciation with “中”, which is usually selected via a number keystroke), and j
, p
, and 6
for “文”.
This is accomplished via the help of the input method frameworks, like the Intelligent Input Bus for Linux/Unix(IBus), Fcitx, and many, many others. Due to the security confinement of snapd additional effort must be made to allow snapped applications communicate with the input method framework running on the host to allow proper text input from CJKV users. Failure of doing so will cause great frustration to these users.
Currently supported input method frameworks
- IBus
- Fcitx
Known issues
Qt5 application can’t communicate with IBus input method framework
Electron-based applications
Currently known has problems using the input methods:
- VisualStudio Code
Binary compatibility issues
Currently it’s been known that snaps shipping Gtk immodules may not work in hosts that using newer Gtk libraries.
How to Help
- Hack the AppArmor policy of the
desktop-legacy
interface to expose more input method frameworks to the snap - Hack the
desktop-launch
launcher script to make necessary runtime changes to make input method frameworks happy