SDB:Wayland input methods

Jump to: navigation, search


Tested on openSUSE

Recommended articles

Icon-manual.png
  • N/A

Related articles

Icon-help.png
  • N/A


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

  1. Open System Settings.
  2. Click Keyboard, then select Virtual Keyboard.
  3. Choose the input method to use:
    • IBus Wayland
    • Fcitx 5

Virtual Keyboard Dialog of System Settings.png

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.

  1. Open Settings.
  2. Go to Keyboard.
  3. Under Input Sources, click + Add Input Source to add a new input method.
  4. 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

Since v140, Wayland detection should be enabled by default; the following configuration might be unnecessary anymore.
  1. Type chrome:flags in the URL box, and access the Experiments page.
  2. 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.


External links