SDB:Wayland input methods

移動先: 案内, 検索



検証済み openSUSE バージョン

推奨記事

Icon-manual.png
  • N/A

関連記事

Icon-help.png
  • N/A


状況

Waylandセッションにおいて、インプットメソッドを設定する方法はX11と異なります。Wayland環境下では、インプットメソッドはコンポジター(デスクトップ環境)によって扱われます。そのため、設定方法はデスクトップ環境によって異なります。

さらに、Wayland環境下では、インプットメソッドに関連した制限事項がいつくつかあります。本記事では Wayland 上でインプットメソッドを使用する方法と、インプットメソッドが正しく機能するために追加のステップが必要なアプリケーションについて、次善策について解説します。


デスクトップごとのインプットメソッド設定方法

以下ではWaylandをサポートするよく使われるデスクトップ環境において、インプットメソッドを有効化する方法について説明します。

KDE Plasma Wayland

KDE Plasma Waylandでは、KWinがインプットメソッドを起動、管理します。KDEでは仮想キーボードと呼ばれます。設定は ~/.config/kwinrc に保存されています。利用可能な仮想キーボードは、/usr/share/applications/ のデスクトップファイルのうち、X-KDE-Wayland-VirtualKeyboard=true を含む desktop ファイルとして列挙することができます。

設定方法

  1. システム設定を開く。
  2. キーボードをクリックし、仮想キーボードを開く。
  3. 使用したいインプットメソッドを選択する:
    • 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) は現時点では Wayland をサポートしていません。デスクトップパネルから KIM Panel ウィジェットを取り除いてください。取り除いた後は、Fcitx 5はWaylandインプットメソッドプロトコルをサポートした独自の候補ウインドウを使用するようになります。

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).

Leap 16.0では、修正としてこの仕組みが配信される予定です。

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, you need to run Slack by the following command:

% flatpak run com.slack.Slack --socket=wayland --ozone-platform=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