SDB:Wayland input methods
Situation
The way input methods are configured in a Wayland session differs from X11. Under Wayland, input methods are handled by the compositor (i.e., the desktop environment), so configuration varies depending on the environment.
In addition, there are certain limitations on input method support under Wayland. This article explains how to use input methods on Wayland and provides workarounds for applications that require additional steps to function properly.
Configuring Input Methods by Desktop Environment
The following sections describe how to enable input methods in the commonly used desktop environments supporting Wayland.
KDE Plasma Wayland
Under KDE Plasma Wayland, KWin manages and launches input methods, which are referred to as virtual keyboards. Their configuration is stored in ~/.config/kwinrc. Available virtual keyboards are listed in desktop entry files that contain the key X-KDE-Wayland-VirtualKeyboard=true, located in /usr/share/applications/.
How to configure
- Open System Settings.
- Click Keyboard, then select Virtual Keyboard.
- Choose the input method to use:
- IBus Wayland
- Fcitx 5
Fcitx's candidate window is always shown on the top left (boo#1085778)
KDE Input Method Panel (KIM Panel) does not support Wayland for now. Please remove KIM Panel widget from your Plasma panel. After that, Fcitx 5 will use its own candidate window supporting Wayland's input method protocol.
The default virtual keyboard
openSUSE provides initial setup scripts (/usr/etc/xdg/plasma-workspace/env/20-*-plasma-setup.sh) for the virtual keyboard. On the first login, if no virtual keyboard is enabled, they will configure the virtual keyboard and enable an input method installed on the system. When both the IBus and Fcitx are installed, they might enable Fcitx according to alphabetical order (but not determined).
GNOME Wayland
How to configure IBus
IBus is the default input method in GNOME.
- Open Settings.
- Go to Keyboard.
- Under Input Sources, click + Add Input Source to add a new input method.
- Select your preferred language and input method (e.g., Japanese (Mozc)).
Mozc's candidate window is placed on the top left with Qt applications (1248592)
Workaround 1: set QT_IM_MODULES environment variable in your ~/.profile or another suitable configuration file:
export QT_IM_MODULES="wayland;ibus"
Workaround 2: disable Mozc Renderer and use GNOME's candidate window by removing "GNOME" from compatible_wayland_desktop_names in ~/.config/ibus_config.textproto
compatible_wayland_desktop_names : []
How to configure Fcitx
WIP
Workarounds for applications
Chromium and its derivatives
- Type chrome:flags in the URL box, and access the Experiments page.
- Set the following options:
- Preferred Ozone platform: Auto
- Wayland text-input-v3: Enabled
Slack (installed from Flatpak)
To allow communication to the current Wayland session, please run:
% flatpak override -u com.slack.Slack --socket=wayland
Visual Studio Code (installed as a RPM package)
To use Wayland and its input method protocol, please set the following environment variable in your ~/.profile or another suitable configuration file:
export ELECTRON_OZONE_PLATFORM_HINT=auto
Migration from X11
INPUT_METHOD and /etc/sysconfig/language
In X11 sessions, the INPUT_METHOD environment variable (configurable via /etc/sysconfig/language) was used to switch between input methods and launch them through XDG autostart. Under Wayland sessions, this variable is not set unless users manually define it in their configuration files, since input methods are managed by the Wayland compositor as described above.
To migrate to Wayland, make sure to unset INPUT_METHOD if you have defined it manually.